<!--
Copyright 2020 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 CustomTabs 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="DetachedResourceRequestFinalStatus">
  <variant name="Failure" summary="Failed detached request"/>
  <variant name="Success" summary="Successful detached request"/>
</variants>

<variants name="DetachedResourceRequestSource">
  <variant name="" summary=""/>
  <variant name=".FromAga" summary="Requests originating from AGA"/>
</variants>

<variants name="IntentToFirstCommitZoom">
  <variant name=".ZoomedIn"
      summary="Zoomed in view: shorter range, more buckets.">
    <owner>lizeb@chromium.org</owner>
    <owner>pasko@chromium.org</owner>
  </variant>
  <variant name=".ZoomedOut"
      summary="Zoomed out view: longer time range, less buckets.">
    <owner>lizeb@chromium.org</owner>
    <owner>pasko@chromium.org</owner>
  </variant>
</variants>

<variants name="StartupSuffix">
  <variant name="Cold" summary=""/>
  <variant name="Speculated"
      summary="When the mayLaunchUrl speculation is used"/>
  <variant name="Warm" summary="When CustomTabsConnection#warmUp is not used"/>
  <variant name="WarmedUp" summary="When CustomTabsConnection#warmUp is used"/>
</variants>

<variants name="StartupSuffixTwa">
  <variant name="Cold" summary=""/>
  <variant name="Warm"
      summary="When the browser process was already started before the TWA
               wrapper started"/>
</variants>

<histogram name="CustomTab.AdaptiveToolbarButton.FallbackUi"
    enum="AdaptiveToolbarButtonVariant" expires_after="2026-10-04">
  <owner>jinsukkiim@google.com</owner>
  <owner>clank-app-team@google.com</owner>
  <summary>
    Records the variant of adaptive toolbar button when its fallback UI was
    clicked. The fallback UI becomes available in the form of overflow menu or
    Message UI when when the button itself was hidden due to various reasons.
    Recorded when the user click the fallback UI. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AdaptiveToolbarButton.ChosenRanking" units="rank"
    expires_after="2027-01-24">
  <owner>jinsukkiim@google.com</owner>
  <owner>clank-app-team@google.com</owner>
  <summary>
    Records the ranking of the toolbar button variant picked up for display. It
    will be either 0 or 1. Recorded when the suggested list of variants are
    checked in the filtering process. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AdaptiveToolbarButton.FallbackIndicator.Clicked"
    enum="AdaptiveToolbarButtonVariant" expires_after="2026-09-27">
  <owner>jinsukkiim@google.com</owner>
  <owner>clank-app-team@google.com</owner>
  <summary>
    Records the variant of adaptive toolbar button for which fallback indicator
    (menu dot) is clicked. Recorded when the overflow menu icon is clicked when
    the indicator is visible. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AdaptiveToolbarButton.FallbackIndicator.Shown"
    enum="AdaptiveToolbarButtonVariant" expires_after="2026-09-20">
  <owner>jinsukkiim@google.com</owner>
  <owner>clank-app-team@google.com</owner>
  <summary>
    Records the variant of adaptive toolbar button for which fallback indicator
    (menu dot) is shown. Recorded when the indicator is shown on the overflow
    menu icon. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AdaptiveToolbarButton.HiddenReason"
    enum="CustomTabsMtbHiddenReason" expires_after="2027-01-24">
  <owner>jinsukkiim@google.com</owner>
  <owner>clank-app-team@google.com</owner>
  <summary>
    Records the reason the Adaptive toolbar button was hidden in Custom Tabs.
    Recorded when the toolbar layout is initialized/updated, or adaptive toolbar
    button is updated on the toolbar. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AdaptiveToolbarButton.Shown"
    enum="AdaptiveToolbarButtonVariant" expires_after="2027-02-07">
  <owner>jinsukkiim@google.com</owner>
  <owner>clank-app-team@google.com</owner>
  <summary>
    Records the variant of adaptive toolbar button shown on the CCT toolbar.
    Recorded when the visibility of the button is determined. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AndroidBrowserHelper.Version" units="versioncode"
    expires_after="2026-09-30">
  <owner>hattorij@google.com</owner>
  <owner>ishitatsuyuki@google.com</owner>
  <owner>lt-performance@google.com</owner>
  <summary>
    Records the version of android_browser_helper during Custom Tabs startup.
  </summary>
</histogram>

<histogram name="CustomTabs.AuthTab.TimeToDalVerification.SinceFlowCompletion2"
    units="ms" expires_after="2027-06-16">
  <owner>sinansahin@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records the time it took to complete the DAL verification since the auth
    flow in the Auth Tab was completed, i.e. navigation to the redirect_uri
    happened. Unlike CustomTabs.AuthTab.TimeToDalVerification.SinceNativeInit,
    this is only recorded when the verification isn't done before the auth flow
    completion. Recorded when OriginVerifier returns a result. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AuthTab.TimeToDalVerification.SinceStart2"
    units="ms" expires_after="2027-06-16">
  <owner>sinansahin@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records the total time it took to complete the DAL verification, regardless
    of the success status, when OriginVerifier returns a result. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.AuthView.UrlParams" units="bit field"
    expires_after="2027-01-24">
  <owner>sinansahin@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    A bit field with each bit representing the presence of a potential OAuth
    query param in the URL. Recorded when the Custom Tab receives and handles
    the initial intent. Android only.

    Available bit flags:

    0b00001: client_id, 0b00010: redirect_uri, 0b00100: response_type, 0b01000:
    scope, 0b10000: state
  </summary>
</histogram>

<histogram name="CustomTabs.AutoclosedSessionDuration" units="ms"
    expires_after="2023-08-20">
  <owner>jinsukkim@chromium.org</owner>
  <owner>twellington@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Android: Duration in milliseconds of a custom tab session (between onResume
    and onPause). This is logged for the sessions closed automatically without
    user intervention. Sessions closed by user input (back press/close button)
    will not be logged.

    Note that there can be user inputs that go undetected by the logic. So the
    histogram can contain false positives i.e. session closed by user but
    regarded as auto-closed.
  </summary>
</histogram>

<histogram name="CustomTabs.Branding.AppIdType"
    enum="CustomTabsBrandingAppIdType" expires_after="2025-07-06">
  <owner>jinsukkim@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    For every CCT launch, Chrome will start an async task in the background
    checking the last time branding is shown for the client app. Each client app
    is identified with a unique string. It was initially (and preferably) its
    package name but is extended to be of any text string from the intent's
    referrer if the package name is unavailable. An empty string is regarded as
    invalid id.

    Record the type of the id for a given CCT when the async task is finished.
    Record for Android CCT only.
  </summary>
</histogram>

<histogram name="CustomTabs.ClientAppId" enum="ClientAppId"
    expires_after="2027-01-31">
  <owner>yusufo@chromium.org</owner>
  <summary>
    Android: AppId declared by the launching application in EXTRA_APPLICATION_ID
    in a custom tab. This histogram is used as a means to count the total
    instances of custom tabs created meanwhile binning them across launching
    apps that have identified themselves. Starting with M84 this is is also
    recorded for webapps/WebAPKs. Filter the platform for just CCT/TWA data.
  </summary>
</histogram>

<histogram name="CustomTabs.ClientAppId.Incognito" enum="ClientAppId"
    expires_after="2026-11-22">
  <owner>zalmashni@google.com</owner>
  <owner>chrome-incognito@google.com</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Android: This histogram is used as a means to count the total instances of
    Incognito custom tabs created meanwhile binning them across launching first
    party apps.

    The launching first party apps are inferred by the package name they
    provided when creating a custom tab connection and if we can't infer via
    package name then as a fallback we rely on them declaring
    EXTRA_APPLICATION_ID when launching Incognito custom tabs. If both fails,
    then the launch is recorded in the Others entry.

    This metric is never recorded for 3P apps.
  </summary>
</histogram>

<histogram name="CustomTabs.CloseCause" enum="CustomTabsCloseCause"
    expires_after="2026-11-29">
  <owner>jinsukkim@chromium.org</owner>
  <owner>twellington@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Android: The reason a custom tab is closed. Main interest is whether a
    custom tab is triggered by user inputs like back press/close button click,
    or it is automatically closed by the app that opened it.
  </summary>
</histogram>

<histogram name="CustomTabs.ConnectionStatusOnReturn.GSA"
    enum="CustomTabsConnection" expires_after="2025-03-09">
  <owner>kgrosu@google.com</owner>
  <owner>jinsukkim@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Android: Recorded whenever user closes the custom tab by hitting the close
    button or back to return to the caller app. Keeps track of the connection
    status and whether the app was using a KeepAlive connection. Recorded only
    for AGSA. Starting with M84 this is is also recorded for webapps/WebAPKs.
    Filter the platform for just CCT/TWA data.
  </summary>
</histogram>

<histogram name="CustomTabs.ConnectionStatusOnReturn.NonGSA"
    enum="CustomTabsConnection" expires_after="2025-07-13">
  <owner>kgrosu@google.com</owner>
  <owner>jinsukkim@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Android: Recorded whenever user closes the custom tab by hitting the close
    button or back to return to the caller app. Keeps track of the connection
    status and whether the app was using a KeepAlive connection. Recorded for
    all apps other than AGSA. Starting with M84 this is is also recorded for
    webapps/WebAPKs. Filter the platform for just CCT/TWA data.
  </summary>
</histogram>

<histogram name="CustomTabs.ContextMenu.DisplayedContextualCustomActionType"
    enum="ContextualCustomActionType" expires_after="2026-10-31">
  <owner>adelm@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records when a custom content action is displayed in the context menu in a
    Custom Tab, broken down by the type of content the action was for (e.g. Link
    or Image). This allows for tracking overall engagement with custom actions
    of different types with respect to the amount of times it was displayed.
  </summary>
</histogram>

<histogram name="CustomTabs.ContextMenu.SelectedContextualCustomActionType"
    enum="ContextualCustomActionType" expires_after="2026-10-31">
  <owner>adelm@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records when a custom content action is selected from the context menu in a
    Custom Tab, broken down by the type of content the action was for (e.g. Link
    or Image). This allows for tracking overall engagement with custom actions
    of different types.
  </summary>
</histogram>

<histogram
    name="CustomTabs.DetachedResourceRequest.Duration.{DetachedResourceRequestFinalStatus}{DetachedResourceRequestSource}"
    units="ms" expires_after="2024-03-17">
  <owner>lizeb@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Time between the start of a detached resource request and its completion
    (failure or success). Android only. Starting with M84 this is is also
    recorded for webapps/WebAPKs. Filter the platform for just CCT/TWA data.
    {DetachedResourceRequestFinalStatus} {DetachedResourceRequestSource}
  </summary>
</histogram>

<histogram name="CustomTabs.DetachedResourceRequest.FinalStatus"
    enum="NetErrorCodes" expires_after="2027-02-21">
  <owner>lizeb@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Reports the final status of the detached request, including success.
    Recorded once per detached resource request. Android only. Starting with M84
    this is is also recorded for webapps/WebAPKs. Filter the platform for just
    CCT/TWA data.
  </summary>
</histogram>

<histogram
    name="CustomTabs.DetachedResourceRequest.RedirectsCount.{DetachedResourceRequestFinalStatus}{DetachedResourceRequestSource}"
    units="redirects" expires_after="2024-03-17">
  <owner>lizeb@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    Number of redirects followed by a detached resource request until success or
    failure. Android only. Starting with M84 this is is also recorded for
    webapps/WebAPKs. Filter the platform for just CCT/TWA data.
    {DetachedResourceRequestFinalStatus} {DetachedResourceRequestSource}
  </summary>
</histogram>

<histogram name="CustomTabs.DeviceSpec" enum="PcctDeviceSpec"
    expires_after="2025-01-12">
  <owner>jinsukkim@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Reports some chosen specs of the device on which PCCT runs. We are
    interested in understanding how many devices running PCCT will be able to
    migrate to Activity Embedding later, which requires that the device not be a
    low-end one and support picture-in-picture feature. Low-endness is defined
    as the return value of API ActivityManager#isLowRamDevice. This is recorded
    only once per Chrome session, when PCCT is launched.
  </summary>
</histogram>

<histogram name="CustomTabs.FeatureUsage" enum="CustomTabsFeatureUsed"
    expires_after="2027-01-17">
  <owner>donnd@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records each feature of a Chrome Custom Tab when that feature is used. A
    single key feature - &quot;Sessions&quot; - is logged once per CCT Session,
    and no other feature enum may be logged more frequently. This provides a
    single large list of features and their percentage usage (one or more times
    per session) right in the UMA timeline. Recorded during a CCT Session.
    Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.GoogleBottomBar.Button.Clicked"
    enum="GoogleBottomBarButtonEvent" expires_after="2025-05-16">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Recorded only on Android. Records clicks on GoogleBottomBar buttons in the
    GoogleBottomBar. Logged when a button is clicked in the GoogleBottomBar
    (when the GoogleBottomBar feature is enabled and visible at the bottom of
    the CCT).
  </summary>
</histogram>

<histogram name="CustomTabs.GoogleBottomBar.Button.Shown"
    enum="GoogleBottomBarButtonEvent" expires_after="2025-07-27">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Recorded only on Android. Records GoogleBottomBar buttons that are shown.
    Logged when a button is displayed in the GoogleBottomBar (when the
    GoogleBottomBar feature is enabled and visible at the bottom of the CCT).
  </summary>
</histogram>

<histogram name="CustomTabs.GoogleBottomBar.Button.Updated"
    enum="GoogleBottomBarButtonEvent" expires_after="2025-05-16">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Recorded only on Android. Records GoogleBottomBar(GBB) buttons that are
    updated. Logged when embedder send request to update a button that is
    displayed in the GoogleBottomBar (when the GoogleBottomBar feature is
    enabled and visible at the bottom of the CCT).
  </summary>
</histogram>

<histogram name="CustomTabs.GoogleBottomBar.Created"
    enum="GoogleBottomBarCreatedEvent" expires_after="2025-07-27">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Recorded only on Android. Records type of the layout used to create the
    GoogleBottomBar. Logged when the GoogleBottomBar is displayed (when the
    GoogleBottomBar feature is enabled and visible at the bottom of the CCT).
  </summary>
</histogram>

<histogram name="CustomTabs.GoogleBottomBar.LensSupportStatus"
    enum="LensSupportStatus" expires_after="2025-07-01">
  <owner>tivi@google.com</owner>
  <owner>gbb-cct@google.com</owner>
  <summary>
    Whether the user supports the Google Lens entrypoint in Google Bottom Bar
    and if not, the reason why. Recorded when user clicks on Lens button in
    Google Bottom bar, that is visible only if the GoogleBottomBarVariantLayouts
    feature is enabled.
  </summary>
</histogram>

<histogram name="CustomTabs.GoogleBottomBar.Variant.Created"
    enum="GoogleBottomBarVariantCreatedEvent" expires_after="2025-07-27">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Recorded only on Android. Records type of the variant layout type used to
    create the GoogleBottomBar. Logged when the GoogleBottomBar is displayed
    (when the GoogleBottomBarVariant feature is enabled and visible at the
    bottom of the CCT).
  </summary>
</histogram>

<histogram name="CustomTabs.HadInteractionOnClose.Form" enum="Boolean"
    expires_after="2025-01-05">
  <owner>katzz@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    This histogram records true when the current CCT has seen any form
    interactions (e.g. text entry, drop down entry) throughout the session and
    false if there have been no form interactions at the time of closing the
    CCT. If the tab is restored the previous form interactions will be reset.
  </summary>
</histogram>

<histogram name="CustomTabs.HadInteractionOnClose.FormStillActive"
    enum="Boolean" expires_after="2025-06-22">
  <owner>katzz@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    This histogram records true when the current CCT has seen form interaction
    (e.g. text entry, drop down entry) on the active page, and false if there
    are no interactions in the active form, or if the interaction is reset (e.g.
    navigation, form submission) at the time of closing the CCT.
  </summary>
</histogram>

<histogram name="CustomTabs.HadInteractionOnClose.Navigation" enum="Boolean"
    expires_after="2025-01-05">
  <owner>katzz@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    This histogram records true when the current CCT has interactions with the
    web contents (e.g. touch, scroll, fling), and the active tab can go back /
    forward and false if there have not been web contents interactions or the
    tab cannot go back / forward at the time of closing the CCT. If the tab is
    restored the previous form interactions will be reset.
  </summary>
</histogram>

<histogram name="CustomTabs.HasNonSpoofablePackageName" enum="Boolean"
    expires_after="2025-01-05">
  <owner>katzz@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Android only. Boolean histogram denoting whether the package name can be
    retrieved in a non-spoofable way for Custom Tabs. When the histogram returns
    true, it means we can confirm the package name was passed by the defined
    host app. Emitted when the Custom Tab is launched.
  </summary>
</histogram>

<histogram name="CustomTabs.IdentityShared" enum="Boolean"
    expires_after="2025-04-27">
  <owner>jinsukkim@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Android only. Boolean histogram denoting whether the package name is
    available by the sender sharing its identity using the new API introduced in
    Android U. This means we can confirm the package name was passed by the
    defined host app. Emitted when the Custom Tab is launched.
  </summary>
</histogram>

<histogram name="CustomTabs.IncognitoCctCallerId" enum="IncognitoCCTCallerId"
    expires_after="2026-12-05">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-incognito@google.com</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    This metrics records the caller of Incognito CCTs. For Chrome features, the
    feature name is recorded, for external calls, either Google App or
    Non-Google App categories are recorded. The metric is recorded when an
    Incognito CCT opening intent is received.

    Warning: this histogram was expired from 2026-03-23 to 2026-12-04; data may
    be missing.
  </summary>
</histogram>

<histogram name="CustomTabs.IncognitoCCTCallerIsTrusted" enum="Boolean"
    expires_after="2026-02-01">
  <owner>dullweber@google.com</owner>
  <owner>chrome-incognito@google.com</owner>
  <owner>cct-team@google.com</owner>
  <summary>
    This metrics records whether a caller who requested Incognito CCT is
    considered trusted. Only recorded when CCTIncognitoAvailableToThirdParty is
    false.
  </summary>
</histogram>

<histogram name="CustomTabs.MayLaunchUrlType" enum="MayLaunchUrlType"
    expires_after="2026-11-15">
  <owner>lizeb@chromium.org</owner>
  <summary>
    Android only. Which flavors of mayLaunchUrl() were used before a tab launch.
    Can be low and/or high confidence. Recorded at the same time as
    CustomTabs.WarmupStateOnLaunch for the buckets &quot;Session, No Warmup,
    Warmup called from another UID&quot;, &quot;Session, No Warmup&quot; and
    &quot;Session, Warmup&quot;.

    Before M118, unlike CustomTabs.WarmupStateOnLaunch, this metric was only
    recorded with a valid session.
  </summary>
</histogram>

<histogram name="CustomTabs.Minimized.MinimizeSuccess" enum="Boolean"
    expires_after="2027-01-17">
  <owner>sinansahin@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Emitted when the the user clicks the minimize button and we request to be
    put in picture-in-picture from the framework. Records true if it was
    successful; false if there was an exception thrown. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.MinimizedFeatureAvailability"
    enum="CustomTabsMinimizedFeatureAvailability" expires_after="2025-08-24">
  <owner>sinansahin@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Minimized Custom Tab feature availability. Recorded during startup in
    #onFinishNativeInitialization() when the availability is first checked to
    initialize the feature. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.Navigation.FinishReason" enum="FinishReason"
    expires_after="2026-09-06">
  <owner>adelm@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    The reason the custom tab activity was finished. Recorded during the
    #finish() phase under CustomTabActivityNavigationController.
  </summary>
</histogram>

<histogram name="CustomTabs.NavigationEvent" enum="CustomTabsNavigationEvent"
    expires_after="2026-12-27">
  <owner>jinsukkim@chromium.org</owner>
  <owner>clank-app-team@chromium.org</owner>
  <summary>
    Records the navigation event occurring in CustomTab and being reported to
    the host app via CustomTabsCallback. Recorded when the events are notified
    to the host app. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.Omnibox.EnabledState" enum="BooleanEnabled"
    expires_after="2026-11-01">
  <owner>ender@google.com</owner>
  <owner>sinansahin@google.com</owner>
  <summary>
    Records whether a CustomTab was requested to include an interactive Omnibox.
    Recorded once per CCT instantiation event. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.Omnibox.FocusResultedInNavigation" enum="Boolean"
    expires_after="2026-07-01">
  <owner>ender@google.com</owner>
  <owner>sinansahin@google.com</owner>
  <summary>
    Records whether user initiated navigation after focusing the Omnibox. Value
    of 'true' indicates user chose to initiate navigation, whereas value of
    'false' suggests the user abandoned the interaction with the Omnibox.
    Recorded once per interaction with Omnibox on CCT when the CCT receives a
    response from SearchActivity. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.Omnibox.NumNavigationsPerSession" units="count"
    expires_after="2027-01-03">
  <owner>ender@google.com</owner>
  <owner>sinansahin@google.com</owner>
  <summary>
    Records the number of navigations issued on CustomTab during its lifetime.
    Recorded only on CCTs that feature an interactive Omnibox. Recorded once per
    CCT when CCT is about to be destroyed. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.OpenType" enum="CustomTabsOpenType"
    expires_after="2026-05-30">
  <owner>jinsukkim@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records how CCT was opened i.e. opened as a new one, opened on top of Google
    search widget results via CCT omnibox, or restored from a disk state file.
    Recored once per CCT when it is initialized. Android only.
  </summary>
</histogram>

<histogram name="CustomTabs.PageContent.Eligibility"
    enum="CustomTabsPageContentEligibility" expires_after="2027-02-14">
  <owner>jinsukkim@google.com</owner>
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records Custom Tab page content features eligibility, detailing if it was
    enabled by embedder, by Chrome developer experiment, or disqualified.
    Android only. Logged once per button click.
  </summary>
</histogram>

<histogram name="CustomTabs.PageContent.Outcome"
    enum="CustomTabsPageContentExtractionResult" expires_after="2027-02-14">
  <owner>jinsukkim@google.com</owner>
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records the detailed outcome of requesting/generating page content values
    (annotated page content URI, screenshots, or file content URIs) for Custom
    Tabs actions. Android only. Logged once per button click.
  </summary>
</histogram>

<histogram name="CustomTabs.PageContent.RequestedTypes"
    enum="CustomTabsPageContentRequestedType" expires_after="2027-02-14">
  <owner>jinsukkim@google.com</owner>
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records each content type (APC, Screenshot, or File) requested inside the
    custom bottom bar view click map from Embedder. Android only. Logged once
    per button click.
  </summary>
</histogram>

<histogram name="CustomTabs.PageInsights.Event" enum="PageInsightsEvent"
    expires_after="2024-12-08">
  <owner>jinsukkim@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Recorded only on Android. Holds the interaction that the user has with Page
    Insights BottomSheet, such as invoking PIH manually or by being auto
    triggered, the bottom sheet's states and when it is dismissed, and
    interactions with xSurface views.
  </summary>
</histogram>

<histogram name="CustomTabs.PageNavigation.ErrorCode" enum="NetErrorCodes"
    expires_after="2026-03-29">
  <owner>jinsukkim@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Network error code occuring upon page navigation. Recorded each time Custom
    tabs receives an event TabObserver.onPageLoadFailed.
  </summary>
</histogram>

<histogram name="CustomTabs.ParallelRequestStatusOnStart"
    enum="CustomTabsParallelRequestStatusOnStart" expires_after="2026-11-01">
  <owner>lizeb@chromium.org</owner>
  <owner>cct-team@google.com</owner>
  <owner>mthiesse@chromium.org</owner>
  <summary>
    Recorded only on Android. Whether a parallel request was requested by the
    calling application, and if so its initial status. Recorded once per handled
    intent, when the request is initiated. Filter the platform for just CCT/TWA
    data. Expired in M120 and brought back in M144.
  </summary>
</histogram>

<histogram name="CustomTabs.PartialCustomTabType"
    enum="CustomTabsPartialCustomTabType" expires_after="2026-08-09">
  <owner>kgrosu@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Type of the Partial Custom Tab that has been created. A new entry will be
    logged each time a PCCT is opened or when the user transitions from a type
    of PCCT to another (e.g. on screen rotation if the type changes from
    bottom-sheet to side-sheet). Multiple entries can be logged for each PCCT
    that is being displayed.
  </summary>
</histogram>

<histogram
    name="CustomTabs.PostMessage.RequestPostMessageChannelWithTargetOrigin"
    enum="Boolean" expires_after="2026-07-19">
  <owner>elabadysayed@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Android only. Recorded when the CCT client calls requestPostMessageChannel
    to establish a two way postMessage channel. Emits true if the request is
    with targetOrigin specified and false otherwise. That should determine if we
    can to delete the old API (Without targetOrigin) or not.
  </summary>
</histogram>

<histogram name="CustomTabs.Prefetch.PrefetchCalled" enum="Boolean"
    expires_after="2026-09-06">
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-prerendering@google.com</owner>
  <summary>
    UseCounter for Custom Tabs Prefetch API. True should be recorded when
    CustomTabsConnection.prefetch is called. False should never be recorded.
    Android CCT only.
  </summary>
</histogram>

<histogram name="CustomTabs.ResetTimeout.ElapsedTimeInMinutesOnReturn"
    units="minutes" expires_after="2026-12-20">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records the elapsed time in minutes from when the user leaves a Custom Tab
    until they return. This is recorded for sessions with an active timeout. The
    value is capped at 3 hours. Recorded upon returning to a CCT. Recorded
    multiple times throughout the CCT session, but only once per &quot;leave
    cycle&quot;. (A leave cycle is the period of time starting when the user
    navigates away from the Custom Tab tracked by activity.onStop until they
    return tracked by activity.onResume or the CCT is closed tracked by
    activity.onDestroy.)
  </summary>
</histogram>

<histogram name="CustomTabs.ResetTimeout.IsFromEmbedder" enum="Boolean"
    expires_after="2026-12-20">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records whether the Custom Tab timeout was configured by the embedding app
    (true) or by a Chrome experiment (false). Recorded when a CCT session is
    started. Recorded once per CCT session.
  </summary>
</histogram>

<histogram name="CustomTabs.ResetTimeout.Outcome"
    enum="CustomTabsResetTimeoutOutcome" expires_after="2026-12-20">
  <owner>tivi@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Records the outcome of Custom Tab sessions that have a configured timeout.
    This metric captures whether the timeout was triggered and how the session
    was handled (e.g., closed due to timeout, timeout ignored). Recorded when a
    CCT session with an active timeout concludes or the timeout condition is
    evaluated. Recorded multiple times throughout the CCT session, but only once
    per &quot;leave cycle&quot;(A leave cycle is the period of time starting
    when the user navigates away from the Custom Tab tracked by activity.onStop
    until they return tracked by activity.onResume or the CCT is closed tracked
    by activity.onDestroy.)
  </summary>
</histogram>

<histogram
    name="CustomTabs.RetainableSessionsV2.TimeBetweenLaunch{IdentifierType}"
    units="seconds" expires_after="2025-05-11">
  <owner>wenyufu@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    When a CCT session is launched, if it is launched with same URL and has the
    same package name or the same taskId + referrer combo, record the duration
    between previous CCT closure and current CCT launch. Recorded on CCT launch.

    A CCT can be defined as retainable if 1) it is launching with the same URL
    as the most recently closed CCT; 2) it is launched from the same embedded
    app as the most recently closed CCT; 3) the most recently closed CCT had
    user interactions. See &quot;CustomTabs.HadInteractionOnClose.Form&quot; and
    &quot;CustomTabs.HadInteractionOnClose.Navigation&quot; for information on
    interactions.

    The histogram suffix identifies whether the CCT is created with the same
    intent Uri data and for the same embedded app, launching CCT with the same
    taskId and package name. The package name identifier to use will depend on
    whether the client app is using CustomTabService. If app is using the CCT
    service, the package name will be read from CCT service; otherwise the
    package name is read from the referrer of CCT activity.

    This histogram is recorded for {IdentifierType}
  </summary>
  <token key="IdentifierType">
    <variant name=".Different"
        summary="App is not launched from the same embedded app as package
                 name / referrer is different."/>
    <variant name=".Mixed"
        summary="Apps not consistently using CCT services. Referrer and
                 package are used together."/>
    <variant name=".PackageName"
        summary="Apps that provide package name. Package name is used as
                 identifier."/>
    <variant name=".Referrer"
        summary="Apps not connecting with CCT services. Activity referrer is
                 used as identifier."/>
  </token>
</histogram>

<histogram name="CustomTabs.SessionDisconnectStatus"
    enum="CustomTabsSessionDisconnectStatus" expires_after="2025-04-13">
  <owner>kgrosu@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Recorded only for Android. Record information about the state of the client
    app, custom tab and system in the moment the connection between the client
    and the custom tab is terminated. With this, we are trying to understand how
    often a connection is terminated (the client app dies/is killed/is closed)
    while a custom tab is in foreground. Also, if the EXTRA_KEEP_ALIVE is set,
    we want to understand if it reduces the number of connections being
    terminated. The aim is that CT_FOREGROUND and CT_FOREGROUND_KEEPALIVE are
    logged as little as possible, while the rest of the states are expected ways
    in which a connection may be terminated.

    *CT_FOREGROUND*/*CT_BACKGROUND* - an enum value that contains this text
    reflects if the custom tab was in the foreground/background when the
    connection was terminated.

    *KEEP_ALIVE* - an enum value that contains this text reflects that the
    EXTRA_KEEP_ALIVE intent extra was specified and that the custom tab binds to
    the service provided by it in order to increase the priority of the client
    app to foreground.

    *LOW_MEMORY* - an enum value that contains this text reflects that the
    system was low on memory when the connection was terminated. This does not
    mean that this was indeed the reason for the connection being terminated,
    but it might be a good indicator of it.

    UNKNOWN - if this is logged then there is probably a bug in the code as we
    have a state we can be in that we don't currently account for.
  </summary>
</histogram>

<histogram name="CustomTabs.SpareRenderer" enum="Boolean"
    expires_after="2026-11-15">
  <owner>adelm@google.com</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Android: Record whether a spare renderer was created when closing a custom
    tab. There are two possible scenarios here: (1) The web page is opened in
    the same browser by reparenting the tab into the browser and no spare
    renderer is created. (2) Any other finish reason should result in the
    creation of a spare renderer. This metric will help us determine whether
    enabling predictive back gesture and deferring to the OS and letting it
    handle the clean up process impacts the spare renderer creation process.
    This will determine whether the behavior remains the same for the enabled
    and control groups to ensure that the feature or change being tested in the
    'enabled' group does not introduce unintended behavioral regressions or
    deviations from the baseline.
  </summary>
</histogram>

<histogram name="CustomTabs.Startup.StartedNavigationEarly" enum="Boolean"
    expires_after="2027-01-17">
  <owner>mthiesse@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Whether or not Navigation was started early for Custom Tab startup. Excludes
    WebApp/WebApk startups.
  </summary>
</histogram>

<histogram name="CustomTabs.Startup.TimeToFirstCommitNavigation2.{suffix}"
    units="ms" expires_after="2027-01-03">
  <owner>mthiesse@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Startup time for a Custom Tab from the earliest point in startup to the
    first navigation commit. Split by varying degrees of warmness, from cold to
    fully pre-loaded through mayLaunchUrl.

    It is recommended to limit analysis of data to Android P+ because on prior
    versions the cold start detection is less robust.

    NOTE: This metric is broken before October 2024 on Pixel 6+ on Android 14+
    due to an issue with the recording of BrowserProcessCreationReason affecting
    ColdStartTracker downstream.

    {suffix}.
  </summary>
  <token key="suffix" variants="StartupSuffix"/>
</histogram>

<histogram name="CustomTabs.Startup.TimeToFirstContentfulPaint.{suffix}"
    units="ms" expires_after="2027-01-03">
  <owner>mthiesse@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Startup time for a Custom Tab from the earliest point in startup to the
    First Contentful Paint on the first navigation. Split by varying degrees of
    warmness, from cold to fully pre-loaded through mayLaunchUrl.

    It is recommended to limit analysis of data to Android P+ because on prior
    versions the cold start detection is less robust.

    NOTE: This metric is broken before October 2024 on Pixel 6+ on Android 14+
    due to an issue with the recording of BrowserProcessCreationReason affecting
    ColdStartTracker downstream.

    {suffix}.
  </summary>
  <token key="suffix" variants="StartupSuffix"/>
</histogram>

<histogram name="CustomTabs.Startup.TimeToLargestContentfulPaint2.{suffix}"
    units="ms" expires_after="2027-02-07">
  <owner>mthiesse@chromium.org</owner>
  <owner>chrome-connective-tissue@google.com</owner>
  <summary>
    Startup time for a Custom Tab from the earliest point in startup to the
    Largest Contentful Paint on the first navigation. Split by varying degrees
    of warmness, from cold to fully pre-loaded through mayLaunchUrl.

    It is recommended to limit analysis of data to Android P+ because on prior
    versions the cold start detection is less robust.

    NOTE: This metric is broken before October 2024 on Pixel 6+ on Android 14+
    due to an issue with the recording of BrowserProcessCreationReason affecting
    ColdStartTracker downstream.

    {suffix}.
  </summary>
  <token key="suffix" variants="StartupSuffix"/>
</histogram>

<histogram name="CustomTabs.TimeSpentInEngagementEventIpc" units="ms"
    expires_after="2027-01-03">
  <owner>nafisabedin@google.com</owner>
  <summary>
    The time spent in milliseconds processing IPCs on the UI thread related to
    Realtime Engagement events for CCTs.

    Recorded only for Android, once per CCT session after the #onSessionEnded
    call, if Realtime Engagement signals are enabled.
  </summary>
</histogram>

<histogram name="CustomTabs.Visible" enum="VisibleTab" expires_after="never">
<!-- expires-never: Used to classify UMA reports by the dashboards. -->

  <owner>yusufo@chromium.org</owner>
  <owner>src/base/metrics/OWNERS</owner>
  <summary>
    Recorded only for Android. Records on every metrics upload whether the
    currently visible tab is a custom tab. The custom tab is launched by a
    client app with customized UI. Some metrics like page load time will behave
    differently for these tabs since it will be possible to warm up the browser
    process and prepare resources for specific urls ahead of time via a service
    connection. This histogram can be used to cluster these metric differently.

    As of M87, this histogram is logged on a log start, rather than log end to
    tag more logs.
  </summary>
</histogram>

<histogram name="CustomTabs.WarmupStateOnLaunch" enum="WarmupStateOnLaunch"
    expires_after="2027-01-31">
  <owner>lizeb@chromium.org</owner>
  <summary>
    Recorded only on Android. Reports whether warmup() has been called when a
    Custom Tabs Intent is received from an application, and if so, whether the
    call could be matched with a session. Starting with M84 this is is also
    recorded for webapps/WebAPKs. Filter the platform for just CCT/TWA data.
  </summary>
</histogram>

<histogram name="CustomTabs.WebAppHeader.BackButtonEvent"
    enum="WebAppBackButtonEvent" expires_after="2027-05-31">
  <owner>vkorotkevich@google.com</owner>
  <owner>pwa-team@google.com</owner>
  <summary>
    Records the usage of back button when running a web app. This is recorded
    only for minimal ui display mode in Trusted Web Activities and WebAPKs.
  </summary>
</histogram>

<histogram name="CustomTabs.WebAppHeader.ControlsHiddenTime2" units="seconds"
    expires_after="2027-05-31">
  <owner>vkorotkevich@google.com</owner>
  <owner>pwa-team@google.com</owner>
  <summary>
    Records how long PWA controls are hidden due to the window size being too
    small. Recorded when transitioning hidden to shown, and on destruction. The
    second version is intorduced, because previously milliseconds were recorded.
  </summary>
</histogram>

<histogram name="CustomTabs.WebAppHeader.ControlsShownTime2" units="seconds"
    expires_after="2027-05-31">
  <owner>vkorotkevich@google.com</owner>
  <owner>pwa-team@google.com</owner>
  <summary>
    Records how long PWA controls are shown before being hidden due to window
    size changes. Recorded when transitioning shown to hidden, and on
    destruction. The second version is intorduced, because previously
    milliseconds were recorded.
  </summary>
</histogram>

<histogram name="CustomTabs.WebAppHeader.DisplayMode2"
    enum="WebAppHeaderDisplayMode" expires_after="2027-08-02">
  <owner>vkorotkevich@google.com</owner>
  <owner>pwa-team@google.com</owner>
  <summary>
    Records the DisplayMode of the the PWA header when it first becomes visible.
    This histogram is a fixed version of a previous one, because buckets didn't
    match DisplayMode enum values.
  </summary>
</histogram>

<histogram name="CustomTabs.WebAppHeader.ReloadButtonEvent"
    enum="WebAppReloadButtonEvent" expires_after="2027-05-31">
  <owner>vkorotkevich@google.com</owner>
  <owner>pwa-team@google.com</owner>
  <summary>
    Records the usage of reload button when running a web app. This is recorded
    only for minimal ui display mode in Trusted Web Activities and WebAPKs.
  </summary>
</histogram>

<histogram name="CustomTabs.WebContentsStateOnLaunch" enum="WebContentsState"
    expires_after="2026-08-23">
  <owner>lizeb@chromium.org</owner>
  <owner>mthiesse@chromium.org</owner>
  <summary>
    Android: When a CustomTabActivity creates its Tab, whether we use a
    prerendered WebContents, a spare renderer or create a new WebContents.

    Note: Expired from April 13-25, 2025.
  </summary>
</histogram>

<histogram name="TrustedWebActivity.ExtraCommandSuccess.{command}"
    enum="BooleanSuccess" expires_after="2025-10-01">
  <owner>peconn@chromium.org</owner>
  <owner>
    src/chrome/android/java/src/org/chromium/chrome/browser/browserservices/OWNERS
  </owner>
  <summary>
    Records whether the extra command {command} called from
    TrustedWebActivityClient resulted in success or failure.
  </summary>
  <token key="command">
    <variant name="checkNotificationPermission"/>
    <variant name="getNotificationPermissionRequestPendingIntent"/>
  </token>
</histogram>

<histogram name="TrustedWebActivity.LaunchHandler.ClientMode"
    enum="TwaLaunchHandlerClientMode" expires_after="2027-06-13">
  <owner>tkachenkoo@google.com</owner>
  <owner>sselyvon@google.com</owner>
  <owner>lt-web-apps-team@google.com</owner>
  <summary>
    Warning: this histogram was expired from 2026-05-01 to 2026-07; data may be
    missing.

    Records the client mode of a web app launched through Trusted Web Activity.
    Client mode is a part of Launch Handler API. Recorded on Trusted Web
    Activity startup if the Launch Handler API is enabled.
  </summary>
</histogram>

<histogram name="TrustedWebActivity.LaunchHandler.FailureReason"
    enum="TwaLaunchHandlerFailureReason" expires_after="2027-06-13">
  <owner>tkachenkoo@google.com</owner>
  <owner>sselyvon@google.com</owner>
  <owner>lt-web-apps-team@google.com</owner>
  <summary>
    Warning: this histogram was expired from 2026-05-01 to 2026-07; data may be
    missing.

    Records the verification failure that caused launch queue to not be notified
    in Trusted Web Activity, if any. Recorded on Trusted Web Activity startup if
    the Launch Handler API is enabled.
  </summary>
</histogram>

<histogram name="TrustedWebActivity.LaunchHandler.FileHandling"
    enum="TwaLaunchHandlerFileHandling" expires_after="2027-06-13">
  <owner>tkachenkoo@google.com</owner>
  <owner>sselyvon@google.com</owner>
  <owner>lt-web-apps-team@google.com</owner>
  <summary>
    Warning: this histogram was expired from 2026-05-01 to 2026-07; data may be
    missing.

    Records the usage of file handling API in Trusted Web Activities, as part of
    Launch Handler API. Recorded on Trusted Web Activity startup if the Launch
    Handler API is enabled. If file handling is not used, NO_FILES will be
    reported.
  </summary>
</histogram>

<histogram name="TrustedWebActivity.Notification.PermissionRequestResult"
    enum="ContentSetting" expires_after="2027-06-13">
  <owner>peconn@chromium.org</owner>
  <owner>
    src/chrome/android/java/src/org/chromium/chrome/browser/browserservices/OWNERS
  </owner>
  <summary>
    Warning: this histogram was expired from 2026-02-01 to 2026-07; data may be
    missing.

    The result of a TWA notification permission request for the purpose of
    notification delegation. This is logged when the
    NotificationPermissionUpdater receives the result from the
    TrustedWebActivityClient.
  </summary>
</histogram>

<histogram
    name="TrustedWebActivity.Startup.TimeToFirstCommitNavigation2.{suffix}"
    units="ms" expires_after="2026-09-30">
  <owner>hattorij@google.com</owner>
  <owner>ishitatsuyuki@google.com</owner>
  <owner>lt-performance@google.com</owner>
  <summary>
    Duration for a TWA from the launch of the TWA to the first navigation
    commit. Split by varying degrees of warmness, from cold to fully pre-loaded
    through mayLaunchUrl.

    {suffix}.
  </summary>
  <token key="suffix" variants="StartupSuffixTwa"/>
</histogram>

<histogram
    name="TrustedWebActivity.Startup.TimeToFirstContentfulPaint.{suffix}"
    units="ms" expires_after="2026-09-30">
  <owner>hattorij@google.com</owner>
  <owner>ishitatsuyuki@google.com</owner>
  <owner>lt-performance@google.com</owner>
  <summary>
    Duration for a TWA from the launch to the First Contentful Paint on the
    first navigation. Split by varying degrees of warmness, from cold to fully
    pre-loaded through mayLaunchUrl.

    {suffix}.
  </summary>
  <token key="suffix" variants="StartupSuffixTwa"/>
</histogram>

<histogram
    name="TrustedWebActivity.Startup.TimeToLargestContentfulPaint2.{suffix}"
    units="ms" expires_after="2026-09-30">
  <owner>hattorij@google.com</owner>
  <owner>ishitatsuyuki@google.com</owner>
  <owner>lt-performance@google.com</owner>
  <summary>
    Duration for a TWA from the launch to the Largest Contentful Paint on the
    first navigation. Split by varying degrees of warmness, from cold to fully
    pre-loaded through mayLaunchUrl.

    {suffix}.
  </summary>
  <token key="suffix" variants="StartupSuffixTwa"/>
</histogram>

</histograms>

</histogram-configuration>
