<!--
Copyright 2026 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 Critical Actions
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>

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

<variants name="ActionSource">
  <variant name="Actor" summary="Actor agent events"/>
  <variant name="Autofill" summary="autofill events"/>
  <variant name="PasswordManager" summary="password manager fill events"/>
</variants>

<!-- LINT.ThenChange(//components/critical_actions/core/browser/critical_action_types.h:ActionSource) -->

<histogram name="CriticalActions.Database.SqliteError"
    enum="SqliteLoggedResultCode" expires_after="2026-11-01">
  <owner>kalinino@google.com</owner>
  <owner>polonium@google.com</owner>
  <summary>
    Records SQLite result and error codes (e.g. constraint violations, disk I/O
    errors, corruption) encountered during SQLite operations in
    CriticalActionDatabase. Recorded in
    CriticalActionDatabase::DatabaseErrorCallback whenever a database operation
    or statement execution returns an error code.
  </summary>
</histogram>

<histogram name="CriticalActions.EventLogged.{ActionSource}"
    enum="CriticalActionType" expires_after="2026-11-01">
  <owner>kalinino@google.com</owner>
  <owner>polonium@google.com</owner>
  <summary>
    Records the ActionType category (e.g. form fill, password manager login,
    federated login, download, OTP) of a critical action. Recorded in
    CriticalActionService::AddCriticalAction whenever a new critical action is
    added to the service to be persisted to the database by {ActionSource}.
  </summary>
  <token key="ActionSource" variants="ActionSource"/>
</histogram>

<histogram name="CriticalActions.VisitIdResolutionOutcome.{ActionSource}"
    enum="CriticalActionVisitIdResolutionOutcome" expires_after="2026-11-01">
  <owner>kutylbeky@google.com</owner>
  <owner>polonium@google.com</owner>
  <summary>
    Records the resolution outcome of resolving a navigation ID to a History
    Visit ID for a critical action triggered by {ActionSource}. Emitted either
    when the navigation ID is resolved to a Visit ID or when the pending action
    is dropped prior to persistence.
  </summary>
  <token key="ActionSource" variants="ActionSource"/>
</histogram>

</histograms>

</histogram-configuration>
