<!--
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 File 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="API-FSP">
  <variant name="onAbortRequested"/>
  <variant name="onAddWatcherRequested"/>
  <variant name="onCloseFileRequested"/>
  <variant name="onConfigureRequested"/>
  <variant name="onCopyEntryRequested"/>
  <variant name="onCreateDirectoryRequested"/>
  <variant name="onCreateFileRequested"/>
  <variant name="onDeleteEntryRequested"/>
  <variant name="onExecuteActionRequested"/>
  <variant name="onGetActionsRequested"/>
  <variant name="onGetMetadataRequested"/>
  <variant name="onMountRequested"/>
  <variant name="onMoveEntryRequested"/>
  <variant name="onOpenFileRequested"/>
  <variant name="onReadDirectoryRequested"/>
  <variant name="onReadFileRequested"/>
  <variant name="onRemoveWatcherRequested"/>
  <variant name="onTruncateRequested"/>
  <variant name="onUnmountRequested"/>
  <variant name="onWriteFileRequested"/>
</variants>

<variants name="CloudProvider">
  <variant name="GoogleDrive"
      summary="The file was opened using the file task for Google
               Drive/Workspace"/>
  <variant name="OneDrive"
      summary="The file was opened using the file task for OneDrive/Microsoft
               365"/>
</variants>

<variants name="GraphAPIMethod">
  <variant name="CopyEntry"/>
  <variant name="CreateDirectory"/>
  <variant name="CreateFile"/>
  <variant name="CreateUploadSession"/>
  <variant name="DeleteEntry"/>
  <variant name="DownloadContent"/>
  <variant name="GetAccessTokenFromCode"/>
  <variant name="GetAccessTokenFromRefreshToken"/>
  <variant name="GetAuthCode"/>
  <variant name="GetDelta"
      summary="delta HTTP call fetching a single results page"/>
  <variant name="GetDeltaAllIncremental"
      summary="incremental delta fetch (sum of all result pages)"/>
  <variant name="GetDeltaAllInitial"
      summary="initial delta fetch (sum of all result pages)"/>
  <variant name="GetDrive"/>
  <variant name="GetEntry"/>
  <variant name="GetProfile"/>
  <variant name="ListDirectory"/>
  <variant name="MoveEntry"/>
  <variant name="UploadContent"/>
</variants>

<!-- Do not confuse this with FileManagerVolumeType, which is an enum
     defined in enums.xml, and can be emitted as the value of a given
     UMA. This is a list of variants that can be used to pattern UMAs
     that should capture the same data across volume types (eg. how
     long it takes to list a directory in that volume type).

    This list should be kept in sync with the
    VolumeManagerCommon.RootType object in
    ui/file_manager/file_manager/common/js/volume_manager_types.js with
    the exception of the last entry ("unknown") which only exists here.
    The order of these variants does not need to match
    VolumeManagerCommon.RootType.
  -->

<variants name="VolumeManagerRootType">
  <variant name="android_files" summary="Android 'Play Files'"/>
  <variant name="archive" summary="Mounted Archive (eg. ZIP, RAR, etc)"/>
  <variant name="computer" summary="Root of a specific Computer"/>
  <variant name="computers_grand_root"
      summary="Root of Drive's 'Computers' view"/>
  <variant name="crostini" summary="Crostini Home Directory"/>
  <variant name="documents_provider" summary="ARC DocumentsProvider"/>
  <variant name="downloads" summary="Downloads directory"/>
  <variant name="drive" summary="Google Drive"/>
  <variant name="drive_fake_root" summary="Fake root of all My Drive etc"/>
  <variant name="drive_offline" summary="Drive's 'Offline' view"/>
  <variant name="drive_recent" summary="Recent files on Drive"/>
  <variant name="drive_shared_with_me" summary="Drive's 'Shared with Me' view"/>
  <variant name="external_media"
      summary="Root of an external media folder under Computers grand root"/>
  <variant name="guest_os" summary="GuestOS"/>
  <variant name="media_view" summary="ARC MediaView"/>
  <variant name="mtp" summary="MTP device (eg. phone, camera)"/>
  <variant name="my_files" summary="My Files"/>
  <variant name="provided" summary="fileSystemProvider"/>
  <variant name="recent" summary="Recent view"/>
  <variant name="removable" summary="Removable storage (eg. USB)"/>
  <variant name="shared_drives_grand_root" summary="Root of 'Shared Drives'"/>
  <variant name="smb" summary="Server Message Block"/>
  <variant name="team_drive" summary="Root of a specific Shared Drive"/>
  <variant name="trash" summary="Trash folder"/>
  <variant name="unknown" summary="Unknown root type"/>
</variants>

<histogram name="DriveCommon.Lifecycle.FirstLaunchTime" units="ms"
    expires_after="2024-04-18">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    How long did it take to launch Google Drive for the first time.
  </summary>
</histogram>

<histogram name="DriveCommon.Lifecycle.Mount" enum="DriveMountStatus"
    expires_after="2024-04-18">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Records outcomes of attempts to mount Google Drive.</summary>
</histogram>

<histogram name="DriveCommon.Lifecycle.MountTime" units="ms"
    expires_after="2024-04-18">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>How long did it take to mount Google Drive.</summary>
</histogram>

<histogram name="DriveCommon.Lifecycle.Unmount" enum="DriveMountStatus"
    expires_after="2024-04-18">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Records outcomes of attempts to unmount Google Drive.</summary>
</histogram>

<histogram name="DriveCommon.LocalSearch.OfflineSearchTime" units="ms"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    How long did it take to perform a lookup of pinned files in local Google
    Drive cache.
  </summary>
</histogram>

<histogram name="DriveCommon.LocalSearch.SharedSearchTime" units="ms"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    How long did it take to perform a search of shared files in local Google
    Drive cache.
  </summary>
</histogram>

<histogram name="DriveCommon.LocalSearch.TextSearchTime" units="ms"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    How long did it take to search a title in local Google Drive cache.
  </summary>
</histogram>

<histogram name="DriveCommon.RemoteSearch.SharedSearchTime" units="ms"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    How long did it take to perform a search of shared files in online Google
    Drive.
  </summary>
</histogram>

<histogram name="DriveCommon.RemoteSearch.TextSearchTime" units="ms"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    How long did it take to perform a search in online Google Drive.
  </summary>
</histogram>

<histogram name="FileBrowser.ArchiveSize.{Extension}" units="100MiB"
    expires_after="2022-12-01">
  <obsolete>
    Became obsolete on 2022-12-01 as we've collected enough data to understand
    the user impact of attempting to open large slow mounters without progress
    reporting.
  </obsolete>
  <owner>msalomao@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The size in units of 100MiB of archives users
    attempt to open. Units are rounded up (e.g., 40MiB gets reported as 100MiB).
  </summary>
  <token key="Extension">
    <variant name="7z"/>
    <variant name="bz"/>
    <variant name="bz2"/>
    <variant name="crx"/>
    <variant name="gz"/>
    <variant name="iso"/>
    <variant name="lz"/>
    <variant name="lzma"/>
    <variant name="rar"/>
    <variant name="tar"/>
    <variant name="taz"/>
    <variant name="tb2"/>
    <variant name="tbz"/>
    <variant name="tbz2"/>
    <variant name="tgz"/>
    <variant name="tlz"/>
    <variant name="tlzma"/>
    <variant name="txz"/>
    <variant name="tz"/>
    <variant name="tz2"/>
    <variant name="tzst"/>
    <variant name="xz"/>
    <variant name="z"/>
    <variant name="zip"/>
    <variant name="zst"/>
  </token>
</histogram>

<histogram name="FileBrowser.ChangeDirectory.RootType"
    enum="FileManagerRootType" expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Counts the number of directory-changed events,
    bucketed by the RootType of the directory newly displayed.
  </summary>
</histogram>

<histogram name="FileBrowser.ComputersCount" units="Computers"
    expires_after="2023-12-04">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: number of Computers a user has available in the
    Files app. Computed every time the File Browser is opened (including file
    picker dialogs). NOTE: This data is biased towards users that use the Files
    App more often.
  </summary>
</histogram>

<histogram name="FileBrowser.Create" enum="FileDialogType" expires_after="M125">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The mode in which the File Browser was opened.
  </summary>
</histogram>

<histogram name="FileBrowser.DirectoryListLoad.{RootType}.{NumFiles}"
    units="ms" expires_after="2024-06-27">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Tracks the user perceived load time for the directory list. Measured from
    the beginning of the directory scan until all entries are scanned (excluding
    metadata). {NumFiles} has a tolerance of 20% which leads to the following
    buckets being tracked: 8-12 files, 80-120 files and 800-1200 files all
    inclusive. Directories whose file counts fall outside these buckets are
    simply not recorded. {RootType} is used to differentiate the load times for
    various volumes.
  </summary>
  <token key="NumFiles">
    <variant name="10"/>
    <variant name="100"/>
    <variant name="1000"/>
  </token>
  <token key="RootType">
    <variant name="my_files"/>
  </token>
</histogram>

<histogram name="FileBrowser.DirectoryScan" units="ms"
    expires_after="2024-02-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: time to scan a directory. Measured on every File
    Browser directory change.
  </summary>
</histogram>

<histogram name="FileBrowser.DirectoryTree.Expand.{RootType}" units="ms"
    expires_after="2024-03-10">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    How long it takes to expand a directory. Measured each time a directory is
    expanded from the directory tree or file list / grid and patterned for all
    known volume types.
  </summary>
  <token key="RootType" variants="VolumeManagerRootType"/>
</histogram>

<histogram name="FileBrowser.DownloadDestination.IsGoogleDrive.Changed"
    enum="BooleanEnabled" expires_after="2024-08-30">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Tracks whether download destination is set to a Google Drive folder when the
    download destination is changed by the user in the settings page.
  </summary>
</histogram>

<histogram name="FileBrowser.DownloadDestination.IsGoogleDrive.Started"
    enum="BooleanEnabled" expires_after="2024-03-03">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Tracks whether download destination is set to a Google Drive folder on
    startup.
  </summary>
</histogram>

<histogram name="FileBrowser.Downloads.DirectoryPercentageOfDiskUsage"
    units="%" expires_after="2024-02-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The size of the space consumed by a users files in &quot;My Files&quot;
    folder and it's children, calculated as a percentage of the total disk
    space. Caluclated on user login and recorded by VolumeManager.
  </summary>
</histogram>

<histogram name="FileBrowser.Downloads.DirectorySizeMiB" units="MiB"
    expires_after="2024-02-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The total size of all of the users files stored in the &quot;My Files&quot;
    folder and it's children. Caluclated on user login and recorded by
    VolumeManager.
  </summary>
</histogram>

<histogram name="FileBrowser.DownloadsCount" units="units"
    expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: number of files and directories in the Downloads
    directory (not including the contents of nested directories). Computed every
    time the File Browser current directory changes to Downloads.
  </summary>
</histogram>

<histogram name="FileBrowser.DriveDuplicateFinder.LongComputeHash" units="ms"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The time taken to calculate the hash of a file, only recorded if the time
    exceeds a local threshold that is currenty 5 seconds.
  </summary>
</histogram>

<histogram name="FileBrowser.DriveDuplicateFinder.LongSearchByHash" units="ms"
    expires_after="M118">
  <obsolete>
    Became obsolete on 2023-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The time taken to search for a file using it's hash value, only recorded if
    the time exceeds a local threshold that is currently 1 second.
  </summary>
</histogram>

<histogram name="FileBrowser.DriveHostedFilePinSuccess" enum="BooleanSuccess"
    expires_after="2024-02-11">
  <owner>austinct@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Tracks success rate of pinning hosted files in Drive.</summary>
</histogram>

<histogram
    name="FileBrowser.DriveOfflineHostedCount.{OpenIsAvailable}.AvailablePercent"
    units="%" expires_after="2024-02-20">
  <owner>joelhockey@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Percent of total Drive hosted files that are available offline, recorded
    when a hosted Drive file is opened.
  </summary>
  <token key="OpenIsAvailable">
    <variant name="OpenFileAvailable"/>
    <variant name="OpenFileUnavailable"/>
  </token>
</histogram>

<histogram
    name="FileBrowser.DriveOfflineHostedCount.{OpenIsAvailable}.{DocsOfflineCounts}"
    units="Files" expires_after="2024-02-20">
  <owner>joelhockey@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Count of Drive hosted files that are or are not available offline, recorded
    when a hosted Drive file is opened. Zero represents errors when docs offline
    extension was not available to query. All values are increased by 1 so we
    can differentiate between errors (0-bucket) and zero count (1-bucket), but
    this will make little difference after the first few buckets since bucket
    size grows large for this 100K histogram with 50 buckets.
  </summary>
  <token key="OpenIsAvailable">
    <variant name="OpenFileAvailable"/>
    <variant name="OpenFileUnavailable"/>
  </token>
  <token key="DocsOfflineCounts">
    <variant name="Available"/>
    <variant name="Total"/>
    <variant name="Unavailable"/>
  </token>
</histogram>

<histogram name="FileBrowser.DriveOfflineOpen.{OpenIsAvailable}"
    enum="ViewFileType" expires_after="2024-02-20">
  <owner>joelhockey@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    File types that are or are not available offline when opened, recorded when
    a Drive file is opened.
  </summary>
  <token key="OpenIsAvailable">
    <variant name="Available"/>
    <variant name="Unavailable"/>
  </token>
</histogram>

<histogram name="FileBrowser.DrivePinSuccess" enum="BooleanSuccess"
    expires_after="2024-02-11">
  <owner>austinct@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Tracks success rate of pinning files in Drive.</summary>
</histogram>

<histogram name="FileBrowser.ExtractTask.Status"
    enum="FileManagerExtractStatus" expires_after="2024-02-11">
  <owner>adanilo@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Tracks success/error rate of extracting archive contents.</summary>
</histogram>

<histogram name="FileBrowser.FileSystemProviderMounted"
    enum="FileSystemProviderMountType" expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The type of file system provider that has been mounted. This metric is
    emmitted on mounting of the filesystem.
  </summary>
</histogram>

<histogram name="FileBrowser.FolderShortcut.Add" units="Shortcuts"
    expires_after="2024-07-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: this is recorded when the user adds a folder
    shortcut.
  </summary>
</histogram>

<histogram name="FileBrowser.FolderShortcut.Count" units="Shortcuts"
    expires_after="2024-07-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: number of saved folder shorcuts. This is recorded
    when the Files app is launched.
  </summary>
</histogram>

<histogram name="FileBrowser.FolderShortcut.Navigate" units="Navigations"
    expires_after="2024-07-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: this is recorded when the user clicks or selects a
    folder shortcut and is navigated to the target folder.
  </summary>
</histogram>

<histogram name="FileBrowser.FolderShortcut.Remove" units="Shortcuts"
    expires_after="2024-07-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: this is recorded when the user removes a folder
    shortcut.
  </summary>
</histogram>

<histogram name="FileBrowser.FormatFileSystemType"
    enum="FileManagerFormatFileSystemType" expires_after="2024-02-20">
  <owner>austinct@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: this records the filesystem selected when formatting
    an external drive.
  </summary>
</histogram>

<histogram name="FileBrowser.Glitch" enum="FileManagerGlitch"
    expires_after="2024-03-17">
  <owner>majewski@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: this records errors and rejected promises that
    occurred during regular use of File Manager. The purpose of this metric is
    to report unexpected errors caught by the global window.onerror handler or
    global unhandledrejection listener. In normal conditions this should never
    happen. However, if it occurs, it is a sign of significant and unexpected
    errors which must not go undetected.
  </summary>
</histogram>

<histogram
    name="FileBrowser.GoogleDrive.BulkPinning.CHOOBEScreenInitializations"
    units="intializations" expires_after="2024-08-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    During CHOOBE (CHoose your own Out-Of-Box Experience) the Drive bulk pinning
    screen lists all the users files to see if all eligible files can fit on the
    device. This metric captures the number of times after the listing of
    eligible files begun that bulk pinning had to initialize. Any number greater
    than 1 indicates multiple restarts and possible recalculation. This does not
    capture restarts that may have occurred prior to bulk pinning starting
    calculation.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.CHOOBEScreenStage"
    enum="GoogleDrive.BulkPinning.Stage" expires_after="2024-08-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The stage the bulk pinning feature was at when the CHOOBE (CHoose your own
    Out-Of-Box Experience) manager asked if the drive pinning screen should be
    skipped or not. The screen will only show if the stage is
    &quot;Success&quot;, all other stages will cause the screen to be skipped.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.Enabled"
    enum="BooleanEnabled" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Tracks whether the Google Drive bulk-pinning feature is enabled on eligible
    devices. This is sampled once per hour, and on eligible devices only.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.Enabled.Source"
    enum="FileManagerGoogleDriveBulkPinningEnabledSource"
    expires_after="2024-07-01">
  <owner>joelhockey@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Records which UI surface was used to enable bulk
    pinning each time it is enabled.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.EnableDocsOfflineResult"
    enum="DriveFileError" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Result returned when trying to enable the Docs offline functionality when
    pinning items.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.Listing.Error"
    enum="GoogleDrive.BulkPinning.Stage" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The final error state that the Google Drive bulk-pinning feature reached
    while listing files.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.MultipleMountFailures"
    enum="GoogleDrive.BulkPinning.MountFailureReason"
    expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Records the reason DriveFS fails to mount consecutively</summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.OfflineOpen"
    enum="ViewFileType" expires_after="2024-07-01">
  <owner>joelhockey@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: File types that a user attempts to open for users
    who have bulk pinning enabled when their device is offline, recorded when a
    Drive file is opened.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.PinnedFiles"
    enum="BooleanPinned" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Counts each file that gets succesfully pinned or not by the Google Drive
    bulk-pinning feature.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.Pinning.Error"
    enum="DriveFileError" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Error returned by DriveFS when the bulk-pinning manager tries to pin a file.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.QueueSize" units="count"
    expires_after="2024-07-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The maximum number of files that can be concurrently downloaded by the
    bulk-pinning manager. This is recorded every time the bulk-pinning manager
    starts pinning files, after having enumerated all the files to pin.
  </summary>
</histogram>

<histogram
    name="FileBrowser.GoogleDrive.BulkPinning.StateWhenCacheVolumeRemoved"
    enum="BooleanEnabled" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    If the LVM cache volume was identified as having been removed, this metric
    is emitted with the current state of bulk pinning (regardless of the state
    it will get disabled, this just captures the state at the time).
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.Syncing.Error"
    enum="GoogleDrive.BulkPinning.Stage" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    The final error state that the Google Drive bulk-pinning feature reached
    while syncing files.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.TimeSpentListing"
    units="ms" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time spent listing eligible files in a users Google Drive. The listing of
    files happens when the user first goes through OOBE, when they open the
    Google Drive settings page or when the click Get started on the bulk pinning
    banner. For the first file listing it will typically make a query to the
    cloud and can take a long time, subsequent queries are done on cached data
    and happen relatively quickly. This is only emitted if the initial listing
    finished successfully.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.BulkPinning.ToDownloadMiB" units="MiB"
    expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Total amount of data that the Google Drive bulk-pinning feature is about to
    download. This is the sum of the sizes of the files that the bulk-pinning
    manager is about to pin and that are not locally cached yet. This metric is
    collected when the bulk-pinning manager is starting to pin files, after it
    ensured there is enough local storage space.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.DailyDSSAvailabilityPercentage"
    units="%" expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Percentage of Docs/Sheets/Slides that are available offline compared to the
    total number of known Docs/Sheets/Slides by DriveFS. A file is considered
    known if DriveFS has cached the metadata for the file. Docs offline can see
    many more files then DriveFS so we prune the list of known files before
    sending this metric. This is emitted after at least 1 day has elapsed since
    the last time it was emitted.
  </summary>
</histogram>

<histogram name="FileBrowser.GoogleDrive.DSSAvailabilityPercentage" units="%"
    expires_after="2024-06-01">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Percentage of Docs/Sheets/Slides that are available offline compared to the
    total number of known Docs/Sheets/Slides by DriveFS. A file is considered
    known if DriveFS has cached the metadata for the file. Docs offline can see
    many more files then DriveFS so we prune the list of known files before
    sending this metric. This is emitted during the polling of Docs offline
    which happens if at least one Files app window is open and only emitted if
    the values changed from the last update.
  </summary>
</histogram>

<histogram
    name="FileBrowser.HoldingSpace.TimeFromFirstWelcomeBannerShowToFirstPin"
    units="ms" expires_after="2024-01-14">
  <owner>dmblack@google.com</owner>
  <owner>tbarzic@chromium.org</owner>
  <summary>
    Chrome OS Files App: Records the time from when the holding space welcome
    banner was first shown to when the user first pinned an item to holding
    space from the Files app. If the holding space welcome banner was not shown
    prior to the first pin, zero is recorded.
  </summary>
</histogram>

<histogram name="FileBrowser.ImportController.DeviceYanked" enum="Boolean"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Whether an external media device was removed during the
    upload process.
  </summary>
</histogram>

<histogram name="FileBrowser.ImportController.ImportCancelled"
    enum="BooleanCanceled" expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Whether the media import process was cancelled.
  </summary>
</histogram>

<histogram name="FileBrowser.Load{FileBrowserLoad}" units="ms"
    expires_after="2024-08-30">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser is an built-in extension without a background page.
    Its main.html file is loaded every time the user opens a File Browser tab or
    a file chooser dialog. The file is fairly large and the initialization is
    pretty expensive. {FileBrowserLoad}
  </summary>
  <token key="FileBrowserLoad">
    <variant name=""/>
    <variant name=".BackgroundLaunch"
        summary="Time from onLaunched event is called to the window is
                 created."/>
    <variant name=".BackgroundRestart"
        summary="Time to create a window on restart."/>
    <variant name=".BackgroundScript"
        summary="Time to initialize backend script to wait for events."/>
    <variant name=".ImportElements"
        summary="Time to initialize the polymer elements."/>
    <variant name=".InitBackgroundPage"
        summary="Time to initialize the background page."/>
    <variant name=".InitDocuments"
        summary="Time to initialize the background page and the elements."/>
    <variant name=".InitSettings" summary="Time to restore user settings."/>
    <variant name=".InitUI"
        summary="Time to initialize all UI after all elements are
                 initialized."/>
    <variant name=".ProcessInitialSearchQuery"
        summary="Time to process LaunchParam.searchQuery (time to find a
                 query-matched directory)."/>
    <variant name=".Script" summary="Time to parse Javascript and CSS."/>
    <variant name=".Total"
        summary="Total load time from the moment the Javascript started
                 parsing till the moment the empty file list is displayed."/>
  </token>
</histogram>

<histogram name="FileBrowser.Location.OnEntryExpandedOrCollapsed.NonTopLevel"
    enum="FileManagerRootType" expires_after="2024-08-30">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: The locations (root types) of non-top-level entries
    when they are expanded or collapsed (expand icon clicked) in the directory
    tree.
  </summary>
</histogram>

<histogram name="FileBrowser.Location.OnEntryExpandedOrCollapsed.TopLevel"
    enum="FileManagerRootType" expires_after="2024-03-03">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: The locations (root types) of top-level entries (root
    entries) when they are expanded or collapsed (expand icon clicked) in the
    directory tree.
  </summary>
</histogram>

<histogram name="FileBrowser.Location.OnEntrySelected.NonTopLevel"
    enum="FileManagerRootType" expires_after="M125">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: The locations (root types) of non-top-level entries
    when they are clicked in the directory tree. Contains incomplete data from
    M80 to M87 inclusively.
  </summary>
</histogram>

<histogram name="FileBrowser.Location.OnEntrySelected.TopLevel"
    enum="FileManagerRootType" expires_after="2024-02-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: The locations (root types) of top-level entries (root
    entries) when they are clicked in the directory tree. Contains incomplete
    data from M80 to M87 inclusively.
  </summary>
</histogram>

<histogram name="FileBrowser.MediaImport.Cancelled" enum="BooleanCanceled"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Whether the media import (Photos/Video) from external
    media was cancelled.
  </summary>
</histogram>

<histogram name="FileBrowser.MediaImport.Duplicates" units="count"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Count of duplicate media (Photos/Videos) files that
    were skipped during a single upload session.
  </summary>
</histogram>

<histogram name="FileBrowser.MediaImport.ErrorCount" units="count"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Number of errors that occured during an upload session.
  </summary>
</histogram>

<histogram name="FileBrowser.MediaImport.ImportCount" units="count"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Count of individual media (Photos/Videos) uploaded from
    a single upload session.
  </summary>
</histogram>

<histogram name="FileBrowser.MediaImport.ImportMB" units="MBytes"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Size of the media (Photos/Videos) uploaded from a
    single upload session.
  </summary>
</histogram>

<histogram name="FileBrowser.MediaImport.Started" enum="BooleanAttempted"
    expires_after="M108">
  <obsolete>
    Became obsolete on 2022-08-18 as this feature is no longer in existence.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Whether the media import (Photos/Video) from external
    media was started.
  </summary>
</histogram>

<histogram name="FileBrowser.MenuItemSelected" enum="FileManagerMenuCommands"
    expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: The commands selected in the menu by the files app.
  </summary>
</histogram>

<histogram name="FileBrowser.Notification.Show"
    enum="FileManagerNotificationType" expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Notification types what were shown to the user.
  </summary>
</histogram>

<histogram name="FileBrowser.Notification.UserAction"
    enum="FileManagerNotificationUserAction" expires_after="2023-12-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The action a user takes when shown a notification.
  </summary>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Errors.Drive"
    enum="OfficeDriveOpenErrors" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Errors that can occur when opening an Office file on
    Drive with Google Drive Web.
  </summary>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Errors.OneDrive"
    enum="OfficeOneDriveOpenErrors" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Errors that can occur when opening an Office file on
    OneDrive with the Microsoft 365 PWA.
  </summary>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.FileHandler.{RootType}.{ConnectionStatus}"
    enum="OfficeFileHandler" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Counts the number of times each file handler is used
    to open MS Office files from Files app.
  </summary>
  <token key="RootType">
    <variant name="Drive" summary="The file is located on Drive"/>
    <variant name="NotDrive" summary="The file is not located on Drive"/>
  </token>
  <token key="ConnectionStatus">
    <variant name="Offline" summary="The user is offline"/>
    <variant name="Online" summary="The user is online"/>
  </token>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.FileOpen.Time.{Transfer}.{Size}.To.{CloudProvider}"
    units="ms" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File app: Latency to open a Office file in the {CloudProvider}.

    Measured from the time after the user confirmed the copy/move, to ignore the
    time waiting for user confirmation. If no confirmation is required, it
    starts from the time that the confirmation would be displayed. The end time
    is just before asking the browser to open the file/URL in tab/PWA.
  </summary>
  <token key="Transfer">
    <variant name="Copy"
        summary="The files have been copied to {CloudProvider}"/>
    <variant name="Move"
        summary="The files have been moved to {CloudProvider}"/>
  </token>
  <token key="Size">
<!-- CL format sorts by name, thus padding the names with 0000 to preserve the
     ordering. Lower bound is inclusive, upper bound is exclusive.
  -->

    <variant name="0000MB-to-1MB"/>
    <variant name="0001MB-to-10MB"/>
    <variant name="0010MB-to-100MB"/>
    <variant name="0100MB-to-1GB"/>
    <variant name="1000MB-and-above"/>
  </token>
  <token key="CloudProvider" variants="CloudProvider"/>
</histogram>

<histogram name="FileBrowser.OfficeFiles.ODFS.FileSize.{Direction}" units="KiB"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: size of files transfered to/from ODFS.
  </summary>
  <token key="Direction">
    <variant name="Download"/>
    <variant name="Upload"/>
  </token>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.ODFS.FileSystemProvider.Completion.{API-FSP}"
    enum="FileSystemProviderOperationCompletion" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Breakdown of how many times ODFS
    fileSystemProviderHandler handler completed successfully, completed after a
    warning is shown, aborted via the notification or aborted automatically.
  </summary>
  <token key="API-FSP" variants="API-FSP"/>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.ODFS.FileSystemProvider.Error.{API-FSP}"
    enum="PlatformFileError" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Result returned by ODFS fileSystemProviderHandler
    handler.
  </summary>
  <token key="API-FSP" variants="API-FSP"/>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.ODFS.FileSystemProvider.Time.{API-FSP}"
    units="ms" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: ODFS fileSystemProviderHandler handler execution
    time.
  </summary>
  <token key="API-FSP" variants="API-FSP"/>
</histogram>

<histogram name="FileBrowser.OfficeFiles.ODFS.GraphAPI.DeltaSize.{Case}"
    units="count" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: number of entries returned in one Graph API delta
    call (this includes multiple requests to fetch all result pages of one delta
    request).
  </summary>
  <token key="Case">
    <variant name="Incremental"/>
    <variant name="Initial"/>
  </token>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.ODFS.GraphAPI.ResponseCode.{GraphAPIMethod}"
    enum="OfficeGraphAPIResult" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: HTTP response code of select Microsoft GraphAPI
    calls.
  </summary>
  <token key="GraphAPIMethod" variants="GraphAPIMethod"/>
</histogram>

<histogram name="FileBrowser.OfficeFiles.ODFS.GraphAPI.Time.{GraphAPIMethod}"
    units="ms" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: latency of select Microsoft GraphAPI calls.
  </summary>
  <token key="GraphAPIMethod" variants="GraphAPIMethod"/>
</histogram>

<histogram name="FileBrowser.OfficeFiles.ODFS.MimeType.{Direction}"
    enum="DownloadMimeTypeResult" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: type of files transferred to/from ODFS.
  </summary>
  <token key="Direction">
    <variant name="Download"/>
    <variant name="Upload"/>
  </token>
</histogram>

<histogram name="FileBrowser.OfficeFiles.ODFS.Throughput.{Direction}"
    units="KiB/s" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: ODFS file transfer speed to/from Microsoft OneDrive.
  </summary>
  <token key="Direction">
    <variant name="Download"/>
    <variant name="Upload"/>
  </token>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Open.FileType.{CloudProvider}"
    enum="OfficeOpenExtensions" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Records the extension of office files that are being
    opened with Drive web or Microsoft 365.
  </summary>
  <token key="CloudProvider" variants="CloudProvider"/>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.Open.IOTaskError.{CloudProvider}.{Transfer}"
    enum="PlatformFileError" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Records the error during upload in the &quot;upload
    and open&quot; workflow for Office files. This metric should add up to the
    sum of FileBrowser.OfficeFiles.Open.UploadResult.* where the result is a
    copy or move operation error (IO task errors).
  </summary>
  <token key="CloudProvider" variants="CloudProvider"/>
  <token key="Transfer">
    <variant name="Copy"
        summary="The files have been copied to {CloudProvider}"/>
    <variant name="Move"
        summary="The files have been moved to {CloudProvider}"/>
  </token>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Open.SourceVolume.{CloudProvider}"
    enum="OfficeFilesSourceVolume" expires_after="M124">
  <owner>austinct@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Records the source volume an office file is opened
    from.
  </summary>
<!-- Defining this token inline instead of using the `CloudProvider` variant
  because this it's spelled differently at call sites in existing builds. -->

  <token key="CloudProvider">
    <variant name="GoogleDrive"
        summary="The file was opened using the file task for Google
                 Drive/Workspace"/>
    <variant name="MicrosoftOneDrive"
        summary="The file was opened using the file task for
                 OneDrive/Microsoft 365"/>
  </token>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Open.TransferRequired.{CloudProvider}"
    enum="OfficeFilesTransferRequired" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Records whether an office file must be transferred
    to Google Drive or Microsoft OneDrive in order to open it.
  </summary>
  <token key="CloudProvider" variants="CloudProvider"/>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Open.UploadResult.{CloudProvider}"
    enum="OfficeFilesUploadResult" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Records the upload result of the &quot;upload and
    open&quot; workflow for Office files.
  </summary>
  <token key="CloudProvider" variants="CloudProvider"/>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Setup.CancelPage"
    enum="OfficeSetupPage" expires_after="M124">
  <owner>austinct@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Records the page at which the user cancels Office
    setup. NOTE: The OneDrive upload page does not get recorded as you cannot
    'cancel' setup at that point.
  </summary>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Setup.FileHandlerSelection"
    enum="OfficeSetupFileHandler" expires_after="M124">
  <owner>austinct@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The file handler the user selects to open an Office
    file with on the first page of setup.
  </summary>
</histogram>

<histogram
    name="FileBrowser.OfficeFiles.Setup.FirstTimeMicrosoft365Availability"
    enum="Microsoft365Availability" expires_after="M124">
  <owner>austinct@chromium.org</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The state of MS365 PWA and ODFS on first setup
    launch.
  </summary>
</histogram>

<histogram name="FileBrowser.OfficeFiles.Setup.ODFSAvailability"
    enum="BooleanAvailable" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Availability of the ODFS extension when mount is
    requested (not including retries within the same flow).
  </summary>
</histogram>

<histogram name="FileBrowser.OfficeFiles.TaskResult.{CloudProvider}"
    enum="OfficeTaskResult" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The result of the task that opens an Office file
    using Drive or OneDrive.
  </summary>
<!-- Defining this token inline instead of using the `CloudProvider` variant
  because this it's spelled differently at call sites in existing builds. -->

  <token key="CloudProvider">
    <variant name="Drive" summary="The task is for Google Drive/Docs"/>
    <variant name="OneDrive"
        summary="The task is for Microsoft OneDrive/Office"/>
  </token>
</histogram>

<histogram name="FileBrowser.OfficeFiles.UseOutsideDrive"
    enum="OfficeFilesUseOutsideDriveHook" expires_after="2024-02-25">
  <owner>cassycc@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: When a user uses a MS Office file outside of Drive,
    records which file system operation is used (File picker selection,
    Copy/Move/Zip or Open from files app).
  </summary>
</histogram>

<histogram name="FileBrowser.OpenFiles.RootType" enum="FileManagerRootType"
    expires_after="2024-02-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The locations (root types) of files which are opened
    by the file picker.
  </summary>
</histogram>

<histogram name="FileBrowser.QuickView.DialogType" enum="FileDialogType"
    expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    File dialog type (e.g. Full page, Save as file) when quick view is launched.
  </summary>
</histogram>

<histogram name="FileBrowser.QuickView.FileType" enum="ViewFileType"
    expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>File types that were tried to be opened with quick view.</summary>
</histogram>

<histogram name="FileBrowser.QuickView.FileTypeOnLaunch" enum="ViewFileType"
    expires_after="M128">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>File types that were selected when quick view is launched.</summary>
</histogram>

<histogram name="FileBrowser.QuickView.VolumeType" enum="FileManagerVolumeType"
    expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>The volume type where quick view is opened.</summary>
</histogram>

<histogram name="FileBrowser.QuickView.WayToOpen"
    enum="FileManagerQuickViewWayToOpen" expires_after="M128">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>How quick view was opened.</summary>
</histogram>

<histogram name="FileBrowser.Recent.FilterByType"
    enum="FileManagerRecentFilterType" expires_after="2024-02-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    This is recorded when different filter buttons in Recent view are clicked.
  </summary>
</histogram>

<histogram name="FileBrowser.Recent.LoadArcMedia" units="ms"
    expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time to load a recently modified file list from Media Views. It is triggered
    when the user opens or reloads Recent view in the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.Recent.LoadCrostini" units="ms"
    expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time to load a recently modified file list from Crostini. It is triggered
    when the user opens or reloads Recent view in the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.Recent.LoadDownloads" units="ms"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time to load a recently modified file list from Downloads. It is triggered
    when the user opens or reloads Recent view in the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.Recent.LoadDrive" units="ms"
    expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time to load a recently modified file list from Drive. It is triggered when
    the user opens or reloads Recent view in the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.Recent.LoadFileSystemProvider" units="ms"
    expires_after="M125">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time to load a recently modified file list from a FileSystemProvider file
    system. It is triggered when the user opens or reloads Recent view in the
    Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.Recent.LoadTotal" units="ms"
    expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time to load a recently modified file list from all sources. It is triggered
    when the user opens or reloads Recent view in the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.Search.ResultCount" units="count"
    expires_after="2024-03-24">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    ChromeOS File Browser: The number of results returned by a search query.
  </summary>
</histogram>

<histogram name="FileBrowser.Search.{Source}.Latency" units="ms"
    expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    ChromeOS File Browser: The time it took to complete user search request.
  </summary>
  <token key="Source">
    <variant name="DocumentsProvider"/>
    <variant name="Drive"/>
    <variant name="Local"/>
    <variant name="Provided"/>
    <variant name="Removable"/>
  </token>
</histogram>

<histogram name="FileBrowser.SWA.Create" enum="FileDialogType"
    expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: When running as SWA, the mode in which the SWA was
    opened. For the non-SWA, see `FileBrowser.Create`.
  </summary>
</histogram>

<histogram name="FileBrowser.SWA.PrefsMigrationStatus"
    enum="FileManagerPrefsMigrationStatus" expires_after="M118">
  <obsolete>
    Became obsolete on 2023-08-18 - It's been around for ~20-30 milestones now
    and most results are either success or failed to find the existing chrome
    preferences. We probably can't get much more actionable insights from this.
  </obsolete>
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: Status of migration of preferences from Chrome app
    version to System Web App
  </summary>
</histogram>

<histogram name="FileBrowser.SyncStatusTrackerMemoryUsage" units="KiB"
    expires_after="2024-08-30">
  <owner>msalomao@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Memory used by the Sync Status Tracker.</summary>
</histogram>

<histogram name="FileBrowser.TeamDrivesCount" units="Team Drives"
    expires_after="2024-08-30">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: number of Team Drives a user has available in the
    Files app. Computed every time the File Browser is opened (including file
    picker dialogs). NOTE: This data is biased towards users that use the Files
    App more often.
  </summary>
</histogram>

<histogram name="FileBrowser.ToggleFileListType" enum="FileManagerListType"
    expires_after="2024-03-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS Files App: Recorded when the Grid View/List View toggle menu icon
    is selected.
  </summary>
</histogram>

<histogram name="FileBrowser.Trash.DirectorySetupFailed"
    enum="FileManagerTrashDirectorySetupFailedStep" expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Recorded when failing to create the trash folder (e.g. .Trash) and it's
    children (e.g. info and files).
  </summary>
</histogram>

<histogram name="FileBrowser.Trash.FailedTrashing" enum="FailedTrashingType"
    expires_after="2024-02-04">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Recorded when an item is attempted to be sent to the trash but fails.
  </summary>
</histogram>

<histogram name="FileBrowser.Trash.RestoreFailedNoParent"
    enum="RestoreFailedNoParentType" expires_after="2024-02-04">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Recorded when an item is attempted to be restored but the parent folder it
    originally came from no longer exists.
  </summary>
</histogram>

<histogram name="FileBrowser.TrashFiles.{RootType}" units="units"
    expires_after="2024-03-24">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Recorded when the Trash directory is loaded and all files for the {RootType}
    are entirely read.
  </summary>
  <token key="RootType">
    <variant name="crostini"/>
    <variant name="downloads"/>
    <variant name="drive"/>
  </token>
</histogram>

<histogram name="FileBrowser.UpdateAvailableApps.{NumApps}" units="ms"
    expires_after="2024-06-27">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Tracks the user perceived load time for the available apps (aka file tasks)
    after the user selecting the files in the file list. Measured from the
    throttled event selection changed (when user changes what files are
    selected) until all the available apps is populated in the DOM. {NumApps}
    has a tolerance of 80% which leads to the following buckets: 2-18 apps and
    20-180 apps. Any selection outside these ranges are simply not recorded.
  </summary>
  <token key="NumApps">
    <variant name="10"/>
    <variant name="100"/>
  </token>
</histogram>

<histogram name="FileBrowser.ViewingFileType" enum="ViewFileType"
    expires_after="2024-08-30">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    File types that were tried to be viewed through browser. This is recorded
    when the user tries to view a file from the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingFileType.Offline" enum="ViewFileType"
    expires_after="2024-03-03">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    File types that were tried to be viewed through browser while the user is
    offline. This is recorded when the user tries to view a file from the Files
    app.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingFileType.Online" enum="ViewFileType"
    expires_after="2024-03-03">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    File types that were tried to be viewed through browser while the user is
    online. This is recorded when the user tries to view a file from the Files
    app.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingRootType" enum="FileManagerRootType"
    expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The locations (root types) of files which are opened
    in stand-alone mode. This does not include files opened in file picker mode.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingRootType.Offline"
    enum="FileManagerRootType" expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The locations (root types) of files which are opened
    in stand-alone mode while the user is offline. This does not include files
    opened in file picker mode.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingRootType.Online" enum="FileManagerRootType"
    expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The locations (root types) of files which are opened
    in stand-alone mode while the user is online. This does not include files
    opened in file picker mode.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingTaskType" enum="FileManagerTaskType"
    expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The type of the handler to be used to open files.
    This is recorded when the user tries to view a file from the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingTaskType.Offline"
    enum="FileManagerTaskType" expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The type of the handler to be used to open files
    when the user is offline. This is recorded when the user tries to view a
    file from the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.ViewingTaskType.Online" enum="FileManagerTaskType"
    expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: The type of the handler to be used to open files
    when the user is online. This is recorded when the user tries to view a file
    from the Files app.
  </summary>
</histogram>

<histogram name="FileBrowser.VolumeType" enum="FileManagerVolumeType"
    expires_after="2024-02-25">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Chrome OS File Browser: counts the number of times volumes are mounted for
    each volume type.
  </summary>
</histogram>

<histogram name="FileBrowser.ZipMountTime.{RootType}" units="ms"
    expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Tracks the time to mount a ZIP archive. Times are only recorded on success.
  </summary>
  <token key="RootType">
    <variant name="Drive"
        summary="The archive to mount is located under the Drive root"/>
    <variant name="MyFiles"
        summary="The archive to mount is a local archive, located under the
                 My files or the Downloads root"/>
    <variant name="Other"/>
  </token>
</histogram>

<histogram name="FileBrowser.ZipTask.Time" units="ms" expires_after="M124">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    Time for the execution of a zipping task. Times are only reported on
    success.
  </summary>
</histogram>

<histogram name="FileSystem.DirectoryDatabaseInit"
    enum="FileSystemDatabaseInitResult" expires_after="never">
<!-- expires-never: core storage metric; consumed in separate dashboard (go/chrome-storage-dashboard) -->

  <owner>dmurph@chromium.org</owner>
  <owner>pwnall@chromium.org</owner>
  <summary>The result of FileSystemDirectoryDatabase initialization.</summary>
</histogram>

<histogram name="FileSystem.DirectoryDatabaseRepair"
    enum="DirectoryDatabaseRepairResult" expires_after="M77">
  <owner>tzik@chromium.org</owner>
  <summary>The result of FileSystemDirectoryDatabase repair.</summary>
</histogram>

<histogram name="FileSystem.OriginDatabaseInit"
    enum="FileSystemDatabaseInitResult" expires_after="never">
<!-- expires-never: core storage metric; consumed in separate dashboard (go/chrome-storage-dashboard) -->

  <owner>dmurph@chromium.org</owner>
  <owner>pwnall@chromium.org</owner>
  <summary>The result of FileSystemOriginDatabase initialization.</summary>
</histogram>

<histogram name="Unzipper.DetectEncoding.Result" enum="ContentEncoding"
    expires_after="2024-02-20">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    ZIP file path encoding, as detected by the Unzipper service.
  </summary>
</histogram>

<histogram name="Unzipper.DetectEncoding.Time" units="ms"
    expires_after="2023-12-17">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>Time to detect ZIP file path encoding.</summary>
</histogram>

<histogram name="ZipFileCreator.Result" enum="ZipFileCreator.Result"
    expires_after="2024-02-11">
  <owner>simmonsjosh@google.com</owner>
  <owner>src/ui/file_manager/OWNERS</owner>
  <summary>
    ZipFileCreator service: Result of a ZIP file creation (success, error or
    cancelled).
  </summary>
</histogram>

</histograms>

</histogram-configuration>
