<!--
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.
-->

<!--

This file describes the enumerations referenced by entries in histograms.xml for
this directory. Some enums may instead be listed in the central enums.xml file
at src/tools/metrics/histograms/enums.xml when multiple files use them.

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

Please follow the instructions in the OWNERS file in this directory to find a
reviewer.
-->

<histogram-configuration>

<!-- Enum types -->

<enums>

<!-- LINT.IfChange(FacilitatedPayments.A2AFlowExitedReason) -->

<enum name="FacilitatedPayments.A2AFlowExitedReason">
  <int value="0" label="The domain of the website is not allowlisted"/>
  <int value="1" label="The user has opted out of the payflow"/>
  <int value="2" label="The user has no supported payment apps available"/>
  <int value="3"
      label="The FOP selector either wasn't shown, or was dismissed without
             user action"/>
  <int value="4" label="The FOP selector was dismissed by a user action"/>
  <int value="5" label="Another type of FOP is selected"/>
  <int value="6" label="The A2A payment flag is not enabled"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:A2AFlowExitedReason) -->

<!-- LINT.IfChange(FacilitatedPayments.AccountLinking.FlowExitedReason) -->

<enum name="FacilitatedPayments.AccountLinking.FlowExitedReason">
  <int value="0" label="Screen not shown"/>
  <int value="1" label="Screen was closed not by the user"/>
  <int value="2" label="Screen was closed by the user"/>
  <int value="3" label="User clicked the No Thanks button"/>
  <int value="4" label="Wallet is not installed"/>
  <int value="5" label="Wallet version is not supported"/>
  <int value="6"
      label="User opted out of the flow using the Settings page pref"/>
  <int value="7" label="No screen lock or biometric setup"/>
  <int value="8"
      label="User's account was determined to be ineligible by the server"/>
  <int value="9" label="User switched to a different tab"/>
  <int value="10" label="User navigated to a different website"/>
  <int value="11" label="Max strikes reached"/>
  <int value="12" label="Required delay after last strike not met"/>
  <int value="13" label="Client token is not available"/>
  <int value="14" label="Payments network interface is not available"/>
  <int value="15" label="GetDetailsForCreatePaymentInstrument request failed"/>
  <int value="16" label="User is ineligible per Payments backend"/>
  <int value="17" label="Action token is not available"/>
  <int value="18" label="User logged out"/>
  <int value="19" label="API client not available"/>
  <int value="20" label="User canceled in GMSCore"/>
  <int value="21" label="GMSCore flow failed"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:AccountLinkingFlowExitedReason) -->

<!-- LINT.IfChange(FacilitatedPayments.AccountLinking.PromptUserAction) -->

<enum name="FacilitatedPayments.AccountLinking.PromptUserAction">
  <int value="0" label="Shown"/>
  <int value="1" label="Accepted"/>
  <int value="2" label="Declined"/>
  <int value="3" label="Dismissed"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:AccountLinkingPromptUserAction) -->

<!-- LINT.IfChange(FacilitatedPayments.EwalletFlowExitedReason) -->

<enum name="FacilitatedPayments.EwalletFlowExitedReason">
  <int value="0" label="Invalid link"/>
  <int value="1"
      label="User opted out of the flow using the Settings page pref"/>
  <int value="2" label="No supported eWallet account"/>
  <int value="3"
      label="The device was in landscape orientation when the payflow was
             triggered"/>
  <int value="4" label="The domain for the payment link is not allowlisted"/>
  <int value="5" label="API client not available"/>
  <int value="6" label="Risk data not available"/>
  <int value="7" label="Client token not available"/>
  <int value="8" label="InitiatePayment request failed"/>
  <int value="9" label="Action token not available"/>
  <int value="10" label="User logged out after selecting payment method"/>
  <int value="11"
      label="The FOP selector either wasn't shown, or was dismissed not as a
             result of a user action"/>
  <int value="12" label="The FOP selector was closed by the user"/>
  <int value="13" label="Foldable devices not supported"/>
  <int value="14" label="Max strikes reached"/>
  <int value="15" label="Another type of FOP is selected"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:EwalletFlowExitedReason) -->

<!-- LINT.IfChange(FacilitatedPayments.EwalletNewAccountLinkingFlowExitedReason) -->

<enum name="FacilitatedPayments.EwalletNewAccountLinkingFlowExitedReason">
  <int value="0" label="No supported eWallet creation option"/>
  <int value="1" label="Multiple supported eWallet creation options found"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:EwalletNewAccountLinkingFlowExitedReason) -->

<enum name="FacilitatedPayments.EwalletScheme">
  <int value="0" label="Invalid merchant paymnet link"/>
  <int value="1" label="DuitNow"/>
  <int value="2" label="ShopeePay"/>
  <int value="3" label="Tngd"/>
  <int value="4" label="PromptPay"/>
  <int value="5" label="Momo"/>
  <int value="6" label="Dana"/>
</enum>

<!-- LINT.IfChange(FacilitatedPayments.FopSelectorAction) -->

<enum name="FacilitatedPayments.FopSelectorAction">
  <int value="0" label="FOP selected."/>
  <int value="1" label="Turn off payment prompt link clicked."/>
  <int value="2" label="Manage payment methods option selected."/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h:FopSelectorAction) -->

<enum name="FacilitatedPayments.InitiatePurchaseActionResult">
  <int value="0" label="Failed"/>
  <int value="1" label="Succeeded"/>
  <int value="2" label="Abandoned"/>
</enum>

<!-- LINT.IfChange(FacilitatedPayments.PaymentLinkFopSelectorAction) -->

<enum name="FacilitatedPayments.PaymentLinkFopSelectorAction">
  <int value="0" label="eWallet selected."/>
  <int value="1" label="Payment app selected."/>
  <int value="2" label="Turn off payment prompt link clicked."/>
  <int value="3" label="Manage payment methods option selected."/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h:PaymentLinkFopSelectorAction) -->

<!-- LINT.IfChange(FacilitatedPayments.Pix.IframeUrlType) -->

<enum name="FacilitatedPayments.Pix.IframeUrlType">
  <int value="0" label="Other non-empty URL"/>
  <int value="1" label="about:blank"/>
  <int value="2" label="Empty URL"/>
  <int value="3" label="about:srcdoc"/>
  <int value="4" label="Non-empty and same origin as main frame"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:PixIframeUrlType) -->

<!-- LINT.IfChange(FacilitatedPayments.Pix.PaymentCodeValidation.RustResult) -->

<enum name="FacilitatedPayments.Pix.PaymentCodeValidation.RustResult">
  <int value="0" label="Dynamic"/>
  <int value="1" label="Static"/>
  <int value="2" label="error: Non-Pix merchant-presented code"/>
  <int value="3"
      label="error: Additional data field template contains no data"/>
  <int value="4" label="error: CRC is not the final data field"/>
  <int value="5" label="error: Unknown Pix code type"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:PixCodeRustValidationResult) -->

<!-- LINT.IfChange(FacilitatedPayments.PixCodeValidationResult) -->

<enum name="FacilitatedPayments.PixCodeValidationResult">
  <int value="0" label="Dynamic"/>
  <int value="1" label="Static"/>
  <int value="2" label="Invalid"/>
  <int value="3" label="Validator failed"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:PixCodeValidationResult) -->

<!-- LINT.IfChange(FacilitatedPayments.PixFlowExitedReason) -->

<enum name="FacilitatedPayments.PixFlowExitedReason">
  <int value="0" label="Code validator failed"/>
  <int value="1" label="Invalid code"/>
  <int value="2"
      label="User opted out of the flow using the Settings page pref"/>
  <int value="3" label="No linked account"/>
  <int value="4"
      label="The device was in landscape orientation when the payflow was
             triggered"/>
  <int value="5" label="API client not available"/>
  <int value="6" label="Risk data not available"/>
  <int value="7" label="Client token not available"/>
  <int value="8" label="InitiatePayment request failed"/>
  <int value="9" label="Action token not available"/>
  <int value="10" label="User logged out after selecting payment method"/>
  <int value="11"
      label="The FOP selector either wasn't shown, or was dismissed not as a
             result of a user action"/>
  <int value="12" label="The FOP selector was closed by the user"/>
  <int value="13" label="The purchase action could not be invoked"/>
  <int value="14" label="Autofilling payment methods disabled"/>
  <int value="15" label="Merchant is not allowlisted"/>
  <int value="16" label="Pix code was copied within an iframe"/>
  <int value="17" label="Pix code was copied in an inactive frame"/>
  <int value="18"
      label="Pix code was copied in CCT with Gboard as the default IME"/>
  <int value="19" label="Static code was copied and is not supported"/>
  <int value="20" label="Pix code copied in a non-allowlisted iframe"/>
  <int value="21" label="Payflow has already started"/>
  <int value="22"
      label="Pix code was copied in a same-origin iframe but the merchant is
             not allowlisted"/>
  <int value="23" label="Pix code was copied in an error document frame"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:PixFlowExitedReason) -->

<!-- LINT.IfChange(FacilitatedPayments.UiScreen) -->

<enum name="FacilitatedPayments.UiScreen">
  <int value="0" label="Hidden"/>
  <int value="1" label="FOP selector"/>
  <int value="2" label="Progress screen"/>
  <int value="3" label="Error screen"/>
</enum>

<!-- LINT.ThenChange(/components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h:UiState) -->

</enums>

</histogram-configuration>
