<!--
Copyright 2025 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
content_extraction 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="ContextualSearchAiModeButtonSurface">
  <variant name="NtpOmnibox" summary="NTP Omnibox"/>
  <variant name="NtpRealbox" summary="NTP Realbox"/>
  <variant name="SrpOmnibox" summary="SRP Omnibox"/>
  <variant name="WebOmnibox" summary="Web Omnibox"/>
</variants>

<!-- LINT.IfChange(ContextualSearchAttachmentButtonType) -->

<variants name="ContextualSearchAttachmentButtonType">
  <variant name="Camera" summary="Camera"/>
  <variant name="Clipboard" summary="Clipboard"/>
  <variant name="CurrentTab" summary="Current Tab button"/>
  <variant name="Drive" summary="Drive file picker"/>
  <variant name="Files" summary="File picker"/>
  <variant name="Gallery" summary="Image picker"/>
  <variant name="RecentTab" summary="Recent Tab"/>
  <variant name="SuggestedTab" summary="Suggested Tab"/>
  <variant name="TabPicker" summary="Tab picker"/>
</variants>

<!-- LINT.ThenChange(//components/contextual_search/contextual_search_metrics_recorder.h:ContextualSearchAttachmentButtonType) -->

<variants name="ContextualSearchFileTypes">
  <variant name="Image"/>
  <variant name="Other"/>
  <variant name="Pdf"/>
  <variant name="Tab"/>
</variants>

<variants name="ContextualSearchFunnel">
  <variant name="AiModeButton"/>
  <variant name="CreateImageChip"/>
  <variant name="DeepDiveChip"/>
  <variant name="DeepSearchChip"/>
  <variant name="PlusButton"/>
  <variant name="RecentTabChip"/>
</variants>

<!-- LINT.IfChange(ContextualSearchSource) -->

<variants name="ContextualSearchSource">
  <variant name="ContextualTasks"/>
  <variant name="Lens"/>
  <variant name="NewTabPage"/>
  <variant name="Omnibox"/>
  <variant name="OmniboxEverywhere"/>
  <variant name="Unknown"/>
</variants>

<!-- LINT.ThenChange(//components/contextual_search/contextual_search_metrics_recorder.h:ContextualSearchSource) -->

<!-- LINT.IfChange(PopupType) -->

<variants name="PopupType">
  <variant name="AimPopup" summary="Context menu opened from aim popup"/>
  <variant name="ClassicPopup"
      summary="Context menu opened from classic popup"/>
</variants>

<!-- LINT.ThenChange(//tools/metrics/actions/actions.xml:PopupType) -->

<histogram
    name="ContextualSearch.ActiveTabsCountOnContextMenuOpen.{ContextualSearchSource}"
    units="count" expires_after="2027-02-14">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the total number of active tabs a user has at the time in which they
    open the composeboxcontext menu. This metric is recorded regardless of
    whether or not a query was issued with the tab.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.AddedTabContextRecencyRanking.{ContextualSearchSource}"
    units="rank" expires_after="2027-01-03">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the relative recency ranking (0-indexed) of a tab across its window
    when a tab is added as context through the composebox context menu. This
    metric is recorded regardless of whether or not a query was issued with the
    tab.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.AddTabsButton.Clicked.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-07-16">
  <owner>ananyaseelam@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the user clicks the &quot;Add Tabs&quot; menu item via keydown
    in the contextual action menu on {ContextualSearchSource}. Always logged as
    true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.AddTabsButton.Hovered.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-07-16">
  <owner>ananyaseelam@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the user hovers over the &quot;Add Tabs&quot; menu item in the
    contextual action menu on {ContextualSearchSource}. Always logged as true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.AddTabsButton.Shown.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-07-16">
  <owner>ananyaseelam@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the &quot;Add Tabs&quot; menu item in the contextual action
    menu is shown on {ContextualSearchSource}. Always logged as true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.AddTabsFlyout.Shown.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-07-16">
  <owner>ananyaseelam@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the &quot;Add Tabs&quot; flyout is opened and tab suggestions
    are shown on {ContextualSearchSource}. Always logged as true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.AddTabsFlyout.TabSelected.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-07-16">
  <owner>ananyaseelam@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the user adds a tab from the &quot;Add Tabs&quot; flyout on
    {ContextualSearchSource}. Always logged as true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.AiModeButtonClick.{ContextualSearchAiModeButtonSurface}"
    enum="Boolean" expires_after="2027-02-14">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the AI mode button is clicked on the
    {ContextualSearchAiModeButtonSurface}. Always recorded as true.
  </summary>
  <token key="ContextualSearchAiModeButtonSurface"
      variants="ContextualSearchAiModeButtonSurface"/>
</histogram>

<histogram
    name="ContextualSearch.AttachmentButtonShown.{ContextualSearchSource}"
    enum="FuseboxAttachmentButtonType" expires_after="2027-05-13">
  <owner>ameurhosni@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records when an attachment button is shown in the composebox.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.AttachmentButtonUsed.{ContextualSearchSource}"
    enum="FuseboxAttachmentButtonType" expires_after="2027-05-13">
  <owner>ameurhosni@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records when an attachment button is used in the composebox.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.AttachmentsMenuToggled.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-05-13">
  <owner>ameurhosni@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records true when the menu is opened. Records false when the menu is closed
    without user action.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.ConfigParseSuccess.{ContextualSearchSource}"
    enum="Boolean" expires_after="2026-06-17">
  <owner>mahmadi@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded the first time the contextual search box is accessed and the
    configuration proto feature parameter is set to a non-empty value. This
    metric records whether the config proto was successfully parsed from the
    base64-encoded string.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.ContextAdded.ContextAddedMethod.{ContextualSearchSource}"
    enum="ContextAddedMethod" expires_after="2027-02-14">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the total number of times a context addition method was used.
    Recorded once every time a file or files are added using a certain context
    addition method. i.e. Recorded once for copy and paste, drag and drop,
    context menu add, etc.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.ContextMenuEntry.Clicked.{ContextualSearchSource}"
    enum="BooleanOccurred" expires_after="2027-01-03">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Number of times the context menu entrypoint on the {ContextualSearchSource}
    was clicked. Recorded when the context menu is clicked. This does not mean
    that a file was added, just simply that the entrypoint was clicked.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.DuplicateTabTitlesShownCount.{ContextualSearchSource}"
    units="count" expires_after="2027-02-07">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded during each session and records the number of tabs shown in the
    context menu UI that have duplicate titles.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Entrypoint.{Result}"
    enum="ContextualSearchSource" expires_after="2027-04-01">
  <owner>christianxu@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records the entrypoint used when a session ended in {Result}. Recorded at
    the end of the session.
  </summary>
  <token key="Result">
    <variant name="Abandoned"/>
    <variant name="Navigated"/>
  </token>
</histogram>

<histogram name="ContextualSearch.ErrorPageShown.{ContextualSearchSource}"
    enum="ContextualSearchErrorPage" expires_after="2027-02-07">
  <owner>nguyenbryan@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the error page is shown, with the reason it was shown.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.File.PickedCount.{ContextualSearchAttachmentButtonType}.{ContextualSearchSource}"
    units="count" expires_after="2027-05-13">
  <owner>ameurhosni@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records the count of attachments picked via a specific button. Recorded when
    the user picks an attachment (image, file, tab).
  </summary>
  <token key="ContextualSearchAttachmentButtonType"
      variants="ContextualSearchAttachmentButtonType"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.File.Size.Tab.PageContents.{ContextualSearchSource}"
    units="bytes" expires_after="2027-05-25">
  <owner>jkoblinsky@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    The size of the extracted page contents for a tab attachment upload,
    qualified by the contextual search source. Emitted when the upload is
    initiated on the client side, before the upload has reached the server.
    Duplicate tab uploads will emit duplicate samples. Both cached and
    non-chached tabs will emit a sample. An emission will still occur if the
    attachment is removed from the attachment list before the server upload is
    complete.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.File.Size.Tab.ViewportScreenshot.{ContextualSearchSource}"
    units="bytes" expires_after="2027-05-25">
  <owner>jkoblinsky@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    The size of the viewport screenshot for a tab attachment upload, qualified
    by the contextual search source. Emitted when the upload is initiated on the
    client side, before the upload has reached the server. Duplicate tab uploads
    will emit duplicate samples. Both cached and non-chached tabs will emit a
    sample. An emission will still occur if the attachment is removed from the
    attachment list before the server upload is complete.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.File.Size.{ContextualSearchFileTypes}.{ContextualSearchSource}"
    units="bytes" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The size of the file received by the browser from the WebUI. Recorded as
    soon as the browser receives it.
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes">
    <variant name=""/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.File.Size.{ContextualSearchSource}"
    units="bytes" expires_after="2027-01-05">
  <owner>wenhuc@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The aggregate size of all file types received by the browser from the WebUI.
    Recorded as soon as the browser receives it.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.File.WebUI.UploadAttemptFailure.{ContextualSearchSource}"
    enum="ContextualSearchFileValidationError" expires_after="2026-05-17">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Records the validation error hit on the WebUI side when a file is uploaded.
    If no error occurred, this is logged as &quot;No error.&quot; Recorded when
    a file upload is attempted.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Inputs.TypeOnSubmission.{ContextualSearchSource}"
    enum="ContextualSearchAimInputType" expires_after="2027-02-07">
  <owner>khalidpeer@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the input types included in the query when the user submitted the
    query. This metric is recorded only once the user has submitted the query
    and navigated to AIM. Emits one sample per unique input type attached to the
    query (e.g. adding 2 images + 1 file at the time of query submission will
    log 2 samples, 1 sample to the image bucket + 1 sample to the file bucket).
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Models.ChangedByAIM.{ContextualSearchSource}"
    enum="OmniboxModelMode" expires_after="2027-08-11">
  <owner>jamesleung@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks model mode changes triggered by AIM webpage via SILK.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Models.ModeOnSubmission.{ContextualSearchSource}"
    enum="OmniboxModelMode" expires_after="2027-02-14">
  <owner>bofengchen@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks what model the user was using when they submitted the query. This
    metric is recorded only once the user has submitted the query and navigated
    to AIM.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Models.Selected.{ContextualSearchSource}"
    enum="OmniboxModelMode" expires_after="2027-05-13">
  <owner>ameurhosni@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records when a model is explicitly selected by the user in the menu.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Models.Shown.{ContextualSearchSource}"
    enum="ContextualSearchAimModel" expires_after="2027-04-01">
  <owner>christianxu@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>Recorded when an AIM model is shown in the composebox menu.</summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Models.{ContextualSearchSource}"
    enum="OmniboxModelMode" expires_after="2027-02-14">
  <owner>bofengchen@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the active model selected in the composebox. Recorded when the user
    switches to a model.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.NoAcMatch.SubmitQuery.{ContextualSearchSource}"
    enum="ContextualSearchNoAcMatchState" expires_after="2027-03-15">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when a query is submitted without an autocomplete match selection
    from {ContextualSearchSource}. Used for debugging query submission
    modalities.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Query.AttachmentCount.{ContextualSearchFileTypes}.{ContextualSearchSource}"
    units="count" expires_after="2027-05-13">
  <owner>ameurhosni@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records the count of attachments of a specific type at query submission.
    Recorded when the user submits a query with attachments.
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Query.FileCount.FunnelMetrics.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-03">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Number of files included in a completed query. May be zero in the case that
    the input was only text. Recorded after navigation to the AIM page occurs.
    Sliced by applicable funnels for the session.
  </summary>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Query.FileCount.{ContextualSearchSource}"
    units="count" expires_after="2027-02-14">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Number of files included in a completed query. May be zero in the case that
    the input was only text. Recorded after navigation to the AIM page occurs.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Query.Modality.V2.FunnelMetrics.{ContextualSearchFunnel}.{ContextualSearchSource}"
    enum="ContextualSearchMultimodalState" expires_after="2027-02-07">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Records the combination of input types used to form the query. Recorded
    after navigation to the AIM page occurs. Sliced by the funnel that initiated
    the session.
  </summary>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Query.Modality.V2.{ContextualSearchSource}"
    enum="ContextualSearchMultimodalState" expires_after="2027-02-07">
  <owner>hujaosonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Records the combination of input types used to form the query. Recorded
    after navigation to the AIM page occurs.

    In M149+, this does not record clicks on the AI Mode button as a query
    submission when no text and no files are present.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Query.TextLength.FunnelMetrics.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="characters" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Number of characters in the composebox submission request. May be zero in
    the case that only a file was uploaded. Recorded after navigation to the AIM
    page occurs. Sliced by applicable funnels for the session.
  </summary>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Query.TextLength.{ContextualSearchSource}"
    units="characters" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Number of characters in the composebox submission request. May be zero in
    the case that only a file was uploaded. Recorded after navigation to the AIM
    page occurs.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Query.Time.ToSubmission.{ContextualSearchSource}"
    units="ms" expires_after="2027-01-31">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the duration from composebox session start time to the time a query
    was submitted. Recorded as soon as the query is submitted, but before
    navigation. Note: A session starts when the compose button is clicked and
    the composebox shown. There may be multiple query submission times recorded
    per composebox shown.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.Duration.Total.{ContextualSearchSource}"
    units="ms" expires_after="2027-02-14">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Contextual search session durations from when the session started to its
    abandonment or completion. A session starts when the compose button is
    clicked and the composebox shown. Completion is when the following happens:
    1) user submits a query 2) user is redirected to the AIM page 3) the
    composebox is closed. Abandonment is when a user closes the composebox or
    closes the NTP without query submission. Recorded at the end of the session.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.Duration.{Status}.{ContextualSearchSource}"
    units="ms" expires_after="2027-02-07">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the duration of composebox sessions from start time to the end of the
    session. Recorded at the end of the session. Note: A session starts when the
    compose button is clicked and the composebox shown. A composebox session
    ends 1) when it is abandoned 2) a query is submitted and the composebox is
    closed. A session can be abandoned by the user closing the composebox or by
    exiting out of the NTP while the composebox is open without having submitted
    a query.
  </summary>
  <token key="Status">
    <variant name="Abandoned"/>
    <variant name="QuerySubmitted"/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadAttemptCount.FunnelMetrics.{ContextualSearchFileTypes}.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of times the browser attempted to process
    {ContextualSearchFileTypes} files. Recorded at the end of the session. Note:
    Only recorded for files that the WebUI approved for file upload (e.g., they
    passed the file size check). Sliced by the funnel that initiated the
    session.
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes"/>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadAttemptCount.FunnelMetrics.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>wenhuc@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The aggregated number of times the browser attempted to process all file
    types. Recorded at the end of the session. Note: Only recorded for files
    that the WebUI approved for file upload (e.g., they passed the file size
    check). Sliced by applicable funnels for the session.
  </summary>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadAttemptCount.{ContextualSearchFileTypes}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of times the browser attempted to process
    {ContextualSearchFileTypes} files. Recorded at the end of the session. Note:
    Only recorded for files that the WebUI approved for file upload (e.g., they
    passed the file size check).
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes">
    <variant name=""/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadAttemptCount.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>wenhuc@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The aggregated number of times the browser attempted to process all file
    types. Recorded at the end of the session. Note: Only recorded for files
    that the WebUI approved for file upload (e.g., they passed the file size
    check).
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadFailureCount.FunnelMetrics.{ContextualSearchFileTypes}.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of failures for {ContextualSearchFileTypes} files within the
    session. Recorded at the end of the session. This does not include files
    that failed browser validation. Note: Only recorded for files that the WebUI
    approved for file upload (e.g., they passed the file size check). Sliced by
    applicable funnels for the session.
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes"/>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadFailureCount.FunnelMetrics.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-19">
  <owner>wenhuc@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of failures aggregated across all file types within the session.
    Recorded at the end of the session. This does not include files that failed
    browser validation. Note: Only recorded for files that the WebUI approved
    for file upload (e.g., they passed the file size check). Sliced by
    applicable funnels for the session.
  </summary>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadFailureCount.{ContextualSearchFileTypes}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of failures for {ContextualSearchFileTypes} files within the
    session. Recorded at the end of the session. This does not include files
    that failed browser validation. Note: Only recorded for files that the WebUI
    approved for file upload (e.g., they passed the file size check).
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes">
    <variant name=""/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadFailureCount.{ContextualSearchSource}"
    units="count" expires_after="2027-01-19">
  <owner>wenhuc@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of failures aggregated across all file types within the session.
    Recorded at the end of the session. This does not include files that failed
    browser validation. Note: Only recorded for files that the WebUI approved
    for file upload (e.g., they passed the file size check).
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadSuccessCount.FunnelMetrics.{ContextualSearchFileTypes}.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2026-12-22">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of successful file upload attempts to the Lens server for
    {ContextualSearchFileTypes} files within the session. Recorded at the end of
    the session. Note: Only recorded for files that the WebUI approved for file
    upload (e.g., they passed the file size check). Sliced by the funnel that
    initiated the session.
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes"/>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadSuccessCount.FunnelMetrics.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-21">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The total number of successful file upload attempts to the Lens server
    aggregated for all file types within the session. Recorded at the end of the
    session. Note: Only recorded for files that the WebUI approved for file
    upload (e.g., they passed the file size check). Sliced by the funnel that
    initiated the session.
  </summary>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadSuccessCount.{ContextualSearchFileTypes}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-03">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The number of successful file upload attempts to the Lens server for
    {ContextualSearchFileTypes} files within the session. Recorded at the end of
    the session. Note: Only recorded for files that the WebUI approved for file
    upload (e.g., they passed the file size check).
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes">
    <variant name=""/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.UploadSuccessCount.{ContextualSearchSource}"
    units="count" expires_after="2027-01-21">
  <owner>wenhuc@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The total number of successful file upload attempts to the Lens server
    aggregated for all file types within the session. Recorded at the end of the
    session. Note: Only recorded for files that the WebUI approved for file
    upload (e.g., they passed the file size check).
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.ValidationFailureCount.{ContextualSearchFileTypes}.{ErrorType}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The total number of {ContextualSearchFileTypes} files that failed validation
    with the error {ErrorType}. Recorded at the end of the session. Note: Only
    recorded for files that the WebUI approved for file upload (e.g., they
    passed the file size check).
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes">
    <variant name=""/>
  </token>
  <token key="ErrorType">
    <variant name="AbortedError"/>
    <variant name="BrowserProcessingError"/>
    <variant name="BrowserProcessingFileEmptyError"/>
    <variant name="BrowserProcessingFileTooLargeError"/>
    <variant name="BrowserProcessingFileUploadNotAllowedError"/>
    <variant name="BrowserProcessingMaxFilesExceededError"/>
    <variant name="BrowserProcessingMaxImagesExceededError"/>
    <variant name="BrowserProcessingMaxPdfsExceededError"/>
    <variant name="BrowserProcessingUnsupportedFileTypeError"/>
    <variant name="ImageProcessingError"/>
    <variant name="NetworkError"/>
    <variant name="ServerError"/>
    <variant name="ServerLimitExceededError"/>
    <variant name="Unknown"/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.Browser.ValidationFailureCount.{ErrorType}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>wenhuc@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    The aggregated number across all file types that failed validation with the
    error {ErrorType}. Recorded at the end of the session. Note: Only recorded
    for files that the WebUI approved for file upload (e.g., they passed the
    file size check).
  </summary>
  <token key="ErrorType">
    <variant name="AbortedError"/>
    <variant name="BrowserProcessingError"/>
    <variant name="BrowserProcessingFileEmptyError"/>
    <variant name="BrowserProcessingFileTooLargeError"/>
    <variant name="BrowserProcessingFileUploadNotAllowedError"/>
    <variant name="BrowserProcessingMaxFilesExceededError"/>
    <variant name="BrowserProcessingMaxImagesExceededError"/>
    <variant name="BrowserProcessingMaxPdfsExceededError"/>
    <variant name="BrowserProcessingUnsupportedFileTypeError"/>
    <variant name="ImageProcessingError"/>
    <variant name="NetworkError"/>
    <variant name="ServerError"/>
    <variant name="ServerLimitExceededError"/>
    <variant name="Unknown"/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.File.DeletedCount.{ContextualSearchFileTypes}.{FileState}.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Count the file deletions from the composebox. This is recorded when a file
    is uploaded and then deleted from the composebox. Every deletion emits true
    if it was successful and false if it was not.
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes">
    <variant name=""/>
  </token>
  <token key="FileState">
    <variant name="NotUploaded" summary="File not uploaded"/>
    <variant name="Processing" summary="File upload processing"/>
    <variant name="ProcessingSuggestSignalsReady"
        summary="File upload processing and suggest signals ready"/>
    <variant name="Unknown" summary="Unknown"/>
    <variant name="UploadFailed" summary="File upload failed"/>
    <variant name="UploadStarted" summary="File upload started"/>
    <variant name="UploadSuccessful" summary="File upload successful"/>
    <variant name="ValidationFailed" summary="File validation failed"/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.QueryCount.FunnelMetrics.{ContextualSearchFunnel}.{ContextualSearchSource}"
    units="count" expires_after="2027-02-14">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the number of queries submitted per session. Multiple queries may be
    submitted when the AIM page is opened in a new tab or window and the
    composebox remains open. Recorded at the end of the session. Sliced by
    applicable funnels for the session.
  </summary>
  <token key="ContextualSearchFunnel" variants="ContextualSearchFunnel"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Session.QueryCount.{ContextualSearchSource}"
    units="count" expires_after="2027-01-03">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the number of queries submitted per session. Multiple queries may be
    submitted when the AIM page is opened in a new tab or window and the
    composebox remains open. Recorded at the end of the session.

    In M149+, this does not record clicks on the AI Mode button as a query
    submission when no text and no files are present.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Session.QuerySubmittedWithoutSessionStart.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-02-07">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks queries that were submitted without calling session start. This
    should never happen. Always recorded as true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.SessionEnd.NavigationResult.{ContextualSearchFileTypes}.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-04-01">
  <owner>christianxu@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    When a session ends either by successful navigation to the response (True)
    or abandonment (False), this metric logs the result for the file state
    associated with {ContextualSearchFileTypes} that was present in the compose
    context.
  </summary>
  <token key="ContextualSearchFileTypes" variants="ContextualSearchFileTypes"/>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.SessionEnd.{Result}.ModelMode.{ContextualSearchSource}"
    enum="ContextualSearchAimModel" expires_after="2027-04-01">
  <owner>christianxu@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records the active model mode used when a composebox session ended in
    {Result}. Recorded at the end of the session.
  </summary>
  <token key="Result">
    <variant name="Abandoned"/>
    <variant name="Navigated"/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.SessionEnd.{Result}.ToolMode.{ContextualSearchSource}"
    enum="OmniboxToolMode" expires_after="2027-04-01">
  <owner>christianxu@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records the active tool mode used when a composebox session ended in
    {Result}. Recorded at the end of the session.
  </summary>
  <token key="Result">
    <variant name="Abandoned"/>
    <variant name="Navigated"/>
  </token>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.SmartTabSharing.MenuOptionClicked"
    enum="SmartTabSharingToggleState" expires_after="2027-07-22">
  <owner>kiehl@google.com</owner>
  <owner>chrome-search-ai@google.com</owner>
  <summary>
    Recorded when a user explicitly toggles the Smart Tab Sharing menu option ON
    or OFF.
  </summary>
</histogram>

<histogram name="ContextualSearch.SmartTabSharing.MenuOptionShown"
    enum="SmartTabSharingSurface" expires_after="2027-07-22">
  <owner>kiehl@google.com</owner>
  <owner>chrome-search-ai@google.com</owner>
  <summary>
    Recorded when the Smart Tab Sharing option is rendered inside the Composebox
    menu.
  </summary>
</histogram>

<histogram name="ContextualSearch.SmartTabSharing.OptOutMidThread"
    enum="Boolean" expires_after="2027-07-22">
  <owner>kiehl@google.com</owner>
  <owner>chrome-search-ai@google.com</owner>
  <summary>
    Records true when the user explicitly turns OFF Smart Tab Sharing mid-thread
    after having already submitted queries with it ON, and false when they
    submit another query with it still ON mid-thread.
  </summary>
</histogram>

<histogram name="ContextualSearch.SmartTabSharing.PromoInteraction"
    enum="SmartTabSharingPromoAction" expires_after="2027-07-22">
  <owner>kiehl@google.com</owner>
  <owner>chrome-search-ai@google.com</owner>
  <summary>
    Tracks user interaction with the FRE IPH or the in-thread &quot;try-it&quot;
    promo (Shown, Turned On, Dismissed/Not Now).
  </summary>
</histogram>

<histogram name="ContextualSearch.SmartTabSharing.TabFilterReason"
    enum="SmartTabSharingFilterReason" expires_after="2027-07-22">
  <owner>kiehl@google.com</owner>
  <owner>chrome-search-ai@google.com</owner>
  <summary>
    Recorded for each open tab evaluated by the on-device model to categorize
    why it was included or filtered out.
  </summary>
</histogram>

<histogram name="ContextualSearch.SmartTabSharing.ThreadWithTabsSubmitted"
    enum="Boolean" expires_after="2027-07-22">
  <owner>kiehl@google.com</owner>
  <owner>chrome-search-ai@google.com</owner>
  <summary>
    Records true if the current AIM thread had Smart Tab Sharing active (toggled
    ON) upon query submission, and false if it was inactive (toggled OFF).
  </summary>
</histogram>

<histogram name="ContextualSearch.TabContextAdded.V2.{ContextualSearchSource}"
    units="count" expires_after="2027-02-14">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the total number of times a tab is added as context through the
    composebox context menu. This metric is recorded regardless of whether or
    not a query was issued with the tab.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.TabContextAddedFromPlusButton.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the total number of times a tab is added as context through the plus
    button in the composebox context menu. This metric is recorded regardless of
    whether or not a query was issued with the tab.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.TabContextAddedFromTabSuggestionChip.{ContextualSearchSource}"
    units="count" expires_after="2027-01-20">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the total number of times a tab is added as context through the tab
    suggestion chip in the composebox. This metric is recorded regardless of
    whether or not a query was issued with the tab.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.TabWithDuplicateTitleClicked.V2.{ContextualSearchSource}"
    units="count" expires_after="2027-02-14">
  <owner>hujasonx@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the total number of times a tab with a duplicate title is clicked
    through the composebox context menu. This metric is recorded regardless of
    whether or not a query was issued with the tab.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Tools.ChangedByAIM.{ContextualSearchSource}"
    enum="OmniboxToolMode" expires_after="2027-08-11">
  <owner>jamesleung@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks tool mode changes triggered by AIM webpage via SILK, such as when the
    user sends a message to AIM that triggers Canvas mode automatically.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.Tools.ModeOnSubmission.{ContextualSearchSource}"
    enum="OmniboxToolMode" expires_after="2027-02-14">
  <owner>bofengchen@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks what tool mode the user was in when they submitted the query. This
    metric is recorded only once the user has submitted the query and navigated
    to AIM.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Tools.Selected.{ContextualSearchSource}"
    enum="OmniboxToolMode" expires_after="2027-05-13">
  <owner>ameurhosni@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>
    Records when a tool is explicitly selected by the user in the menu.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Tools.Shown.{ContextualSearchSource}"
    enum="OmniboxToolMode" expires_after="2027-04-01">
  <owner>christianxu@google.com</owner>
  <owner>chrome-mobile-search@google.com</owner>
  <summary>Recorded when an AIM tool is shown in the composebox menu.</summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram name="ContextualSearch.Tools.{ContextualSearchSource}"
    enum="OmniboxToolMode" expires_after="2027-02-14">
  <owner>bofengchen@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Tracks the active tool selected in the composebox. Recorded when the user
    switches to a tool.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.TypedSuggestNavigation.IsVerbatim.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-02-07">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when a user navigates to a suggestion in typed mode from
    {ContextualSearchSource}. Logs true if the suggestion was verbatim, and
    false otherwise (SearchSuggest).
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.UserAction.DeleteAutoSuggestedTab.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-02-14">
  <owner>sophiechang@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Records every time the user deletes the auto-suggested tab context chip from
    the composebox. Always recorded as true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.UserAction.InputStateDeletion.{ContextualSearchSource}"
    enum="ContextualSearchInputStateDeletionType" expires_after="2027-03-15">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Records the type of input state deleted from the composebox. Recorded when
    the user deletes a file, tab, or tool.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.UserAction.SubmitQueryV2.{ContextualSearchSource}"
    enum="ContextualSearchContextState" expires_after="2027-03-15">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Records the context state when a query is submitted from
    {ContextualSearchSource}. Note that more than one entry can be submitted per
    query submission if it overlaps with WithContextNoText.

    In M149+, this does not record clicks on the AI Mode button as a query
    submission when no text and no files are present.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.UserAction.SubmitVoiceQuery.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-03-10">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when a query is submitted through a voice query from
    {ContextualSearchSource}. Always recorded as true.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="ContextualSearch.ZeroSuggestClickV2.IsContextual.{ContextualSearchSource}"
    enum="Boolean" expires_after="2027-02-14">
  <owner>niharm@google.com</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when a user clicks on a suggestion in zero-suggest mode from
    {ContextualSearchSource}. Logs true if the suggestion was contextual, and
    false otherwise. A query that is submitted with a file uploaded and no text
    is not considered a non-contextual zero suggest click.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
</histogram>

<histogram
    name="{ContextualSearchSource}.AimEntrypoint.{PopupType}.ContextualElement.Clicked"
    enum="ContextType" expires_after="2027-01-17">
  <owner>mfacey@chromium.org</owner>
  <owner>mahmadi@chromium.org</owner>
  <owner>khalidpeer@chromium.org</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the user opens the context menu in a WebUI searchbox (omnibox,
    realbox, etc.) and selects a menu item. The file and image upload is
    recorded when the user uploads a file or image with the file selector.

    This metric logs which context menu item type is clicked.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
  <token key="PopupType" variants="PopupType"/>
</histogram>

<histogram
    name="{ContextualSearchSource}.AimEntrypoint.{PopupType}.ContextualElement.Shown"
    enum="ContextType" expires_after="2027-01-17">
  <owner>mfacey@chromium.org</owner>
  <owner>mahmadi@chromium.org</owner>
  <owner>khalidpeer@chromium.org</owner>
  <owner>chrome-desktop-search@google.com</owner>
  <summary>
    Recorded when the user opens the context menu in a WebUI searchbox (omnibox,
    realbox, etc.).

    This metric logs which context menu item types are shown when the context
    menu is opened.
  </summary>
  <token key="ContextualSearchSource" variants="ContextualSearchSource"/>
  <token key="PopupType" variants="PopupType"/>
</histogram>

</histograms>

</histogram-configuration>
