<!--
Copyright 2024 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!--
This file is used to generate a comprehensive list of Sensitive Content histograms
along with a detailed description for each histogram.

For best practices on writing histogram descriptions, see
https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

Please follow the instructions in the OWNERS file in this directory to find a
reviewer. If no OWNERS file exists, please consider signing up at
go/reviewing-metrics (Googlers only), as all subdirectories are expected to
have an OWNERS file. As a last resort you can send the CL to
chromium-metrics-reviews@google.com.
-->

<histogram-configuration>

<histograms>

<variants name="Embedder">
  <variant name="Chrome" summary="Chrome for Android"/>
  <variant name="WebView" summary="WebView"/>
</variants>

<variants name="TabSwitchingSurface">
  <variant name="BottomTabStripGroupUI" summary="bottom tab strip group UI"/>
  <variant name="IncognitoTabSwitcherPane"
      summary="incognito tab switcher pane"/>
  <variant name="RegularTabSwitcherPane" summary="regular tab switcher pane"/>
</variants>

<histogram name="SensitiveContent.SensitiveTabSwitchingAnimations"
    enum="TabSwitchingAnimation" expires_after="2025-11-16">
  <owner>jkeitel@google.com</owner>
  <owner>chrome-autofill-alerts@google.com</owner>
  <summary>
    Records how many times each tab switching animation is marked as sensitive.
    Emitted every time a tab switching animation occurs and is marked as
    sensitive. A tab switching animation is marked as sensitive if it offers a
    preview of a sensitive tab. Each bucket of this histogram represents one
    type of tab switching animation.
  </summary>
</histogram>

<histogram
    name="SensitiveContent.TabSwitching.{TabSwitchingSurface}.Sensitivity"
    enum="TabSwitchingSurfaceContentSensitivity" expires_after="2025-11-16">
  <owner>jkeitel@google.com</owner>
  <owner>chrome-autofill-alerts@google.com</owner>
  <summary>
    Records whether the {TabSwitchingSurface} is sensitive. The
    {TabSwitchingSurface} is sensitive if at least one of the tabs is sensitive
    at the moment when the {TabSwitchingSurface} is opened. Emitted every time
    the {TabSwitchingSurface} is opened. The {TabSwitchingSurface} has the same
    content sensitivity from the moment it is opened until the moment it is
    closed. Only recorded on Chrome for Android.
  </summary>
  <token key="TabSwitchingSurface" variants="TabSwitchingSurface"/>
</histogram>

<histogram name="SensitiveContent.{Embedder}.LatencyUntilSensitive" units="ms"
    expires_after="2026-01-11">
  <owner>jkeitel@google.com</owner>
  <owner>chrome-autofill-alerts@google.com</owner>
  <summary>
    Records the latency between the moment when a sensitive form appears in the
    DOM (or from the moment the form becomes sensitive, if initially not
    sensitive) and the moment when the content is marked as sensitive, in
    {Embedder}. This metric is emitted only when the content sensitivity changes
    from not sensitive to sensitive.
  </summary>
  <token key="Embedder" variants="Embedder"/>
</histogram>

<histogram name="SensitiveContent.{Embedder}.SensitiveTime" units="ms"
    expires_after="2026-01-11">
  <owner>jkeitel@google.com</owner>
  <owner>chrome-autofill-alerts@google.com</owner>
  <summary>
    Records for how long the content was marked as sensitive, in {Embedder}.
    That is, it measures the time elapsed between when the content was last
    marked as sensitive until the content was last marked as not sensitive. This
    metric is emitted every time the content sensitivity of a WebContents
    changes from sensitive to not sensitive.
  </summary>
  <token key="Embedder" variants="Embedder"/>
</histogram>

<histogram name="SensitiveContent.{Embedder}.SensitivityChanged"
    enum="ContentSensitivity" expires_after="2026-01-11">
  <owner>jkeitel@google.com</owner>
  <owner>chrome-autofill-alerts@google.com</owner>
  <summary>
    Emitted when the content changed its sensitivity from sensitive to not
    sensitive and vice-versa, in {Embedder}. On page load, the content is
    considered not sensitive. This metric gets recorded every time the content
    sensitivity of a WebContents changes.
  </summary>
  <token key="Embedder" variants="Embedder"/>
</histogram>

</histograms>

</histogram-configuration>
