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

<!--

        You DON'T need an OWNER review to submit changes to this file.

This file describes the enumerations used in metrics data.  It is used
along with histograms.xml to describe the histogram data collected by Chrome.

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

Please pretty-print and validate your edits by running the pretty_print.py
and validate_format.py scripts in the same directory as this file before
uploading your change for review.  These are checked by presubmit scripts.
-->

<histogram-configuration>

<!-- Enum types -->

<enums>

<enum name="CanMakePaymentPreferenceSetter">
  <int value="0" label="Unknown"/>
  <int value="1" label="User Setting"/>
  <int value="2" label="Standalone Browser (ChromeOS-only)"/>
  <int value="3" label="Extension"/>
  <int value="4" label="Custodian"/>
  <int value="5" label="Admin Policy"/>
</enum>

<enum name="InternalPaymentAppAvailability">
<!-- Must be kept in sync with the enum of the same name in internal Chrome for Android code. -->

  <int value="0" label="Unknown"/>
  <int value="1" label="Not Applicable - non-internal method"/>
  <int value="2" label="Available"/>
  <int value="3" label="Unavailable - Payment Request being aborted"/>
  <int value="4" label="Unavailable - Cannot get page context"/>
  <int value="5" label="Unavailable - Cannot use first-party Play Services"/>
  <int value="6" label="Unavailable - Play Services is too old"/>
  <int value="7"
      label="Unavailable - Used legacy https://android.com/pay method"/>
  <int value="8" label="Unavailable - Connection to Play Services failed"/>
  <int value="9"
      label="Unavailable - Connection to Play Services was suspended"/>
  <int value="10" label="Unavailable - IsReadyToPay task failed"/>
  <int value="11" label="Unavailable - IsReadyToPay task returned false"/>
</enum>

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

<enum name="PaymentHandlerPausedResolutionOutcome">
  <int value="0" label="User Interacted"/>
  <int value="1" label="Window Closed"/>
</enum>

<!-- LINT.ThenChange(//components/payments/core/payment_request_metrics.h:PaymentHandlerPausedResolutionOutcome) -->

<enum name="PaymentRequestAddressEditorMode">
  <int value="0" label="Add new address"/>
  <int value="1" label="Edit existing address"/>
</enum>

<enum name="PaymentRequestCheckoutFunnelSteps">
  <int value="0" label="Initiated"/>
  <int value="1" label="Show() called"/>
  <int value="2" label="Payment request triggered (shown + skipped show)"/>
  <int value="3" label="Payment handler invoked"/>
  <int value="4" label="Completed"/>
</enum>

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

<enum name="PaymentRequestOutcome">
  <int value="0" label="Success"/>
  <int value="1" label="Aborted by user"/>
  <int value="2" label="Aborted by merchant"/>
  <int value="3" label="Aborted due to invalid data from renderer"/>
  <int value="4" label="Aborted due to Mojo connection error"/>
  <int value="5" label="Aborted due to Mojo renderer closing"/>
  <int value="6" label="Aborted due to instrument details error"/>
  <int value="7" label="Aborted: No matching payment method (Deprecated)"/>
  <int value="8" label="Aborted: No supported payment method (Deprecated)"/>
  <int value="9" label="Aborted due to other reasons"/>
  <int value="10" label="Aborted due to user navigation"/>
  <int value="11" label="Aborted due to merchant navigation"/>
  <int value="12" label="Aborted: User opted out"/>
  <int value="13" label="Aborted due to internal error"/>
  <int value="14" label="Could not show: Another UI already showing"/>
  <int value="15" label="Could not show: User activation required"/>
  <int value="16" label="Could not show: Background tab"/>
  <int value="17" label="Could not show: No supported payment method"/>
</enum>

<!-- LINT.ThenChange(//components/payments/core/payment_request_metrics.h:PaymentRequestOutcome) -->

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

<enum name="PaymentRequestTryShowOutcome">
  <int value="0" label="Able to show"/>
  <int value="1" label="Cannot show due to an unknown reason"/>
  <int value="2" label="Cannot show due to null delegate"/>
  <int value="3"
      label="Cannot show due to existing PaymentRequest in same tab"/>
  <int value="4"
      label="Cannot show due to existing PaymentRequest in different tab"/>
</enum>

<!-- LINT.ThenChange(//components/payments/content/payment_request_display_manager.h:PaymentRequestTryShowOutcome) -->

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

<enum name="SecurePaymentConfirmationBrowserBoundKeyDeviceResult">
  <int value="0" label="Success (Device supports hardware)"/>
  <int value="1" label="Success (No device hardware support)"/>
  <int value="2" label="Failure (Device supports hardware)"/>
  <int value="3" label="Failure (No device hardware support)"/>
</enum>

<enum name="SecurePaymentConfirmationBrowserBoundKeyInclusionResult">
  <int value="0" label="Included (New Browser Bound Key)"/>
  <int value="1" label="Included (Existing Browser Bound Key)"/>
  <int value="2" label="Not included (Device supports hardware)"/>
  <int value="3" label="Not included (No device hardware support)"/>
</enum>

<!-- LINT.ThenChange(//components/payments/core/secure_payment_confirmation_metrics.h:BrowserBoundKeys) -->

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

<enum name="SecurePaymentConfirmationLocaleOutcome">
  <int value="0" label="LocaleNotProvided"/>
  <int value="1" label="Match"/>
  <int value="2" label="NoMatch"/>
</enum>

<!-- LINT.ThenChange(//components/payments/core/secure_payment_confirmation_metrics.h:SecurePaymentConfirmationLocaleOutcome) -->

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

<enum name="SecurePaymentRequestOutcome">
  <int value="0" label="Unknown"/>
  <int value="1" label="User wants to continue with the SPC authentication"/>
  <int value="2" label="User wants to verify their transaction in another way"/>
  <int value="3" label="User wants to cancel their entire transation"/>
  <int value="4" label="User wants to opt out of future SPC authentications"/>
</enum>

<!-- LINT.ThenChange(//components/payments/content/android/spc/java/src/org/chromium/components/payments/secure_payment_confirmation/SecurePaymentConfirmationController.java:SecurePaymentRequestOutcome, //components/payments/content/secure_payment_confirmation_controller.h:SecurePaymentRequestOutcome) -->

</enums>

</histogram-configuration>
