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

<!-- Enum types -->

<enums>

<enum name="ChangePinEvent">
  <int value="0" label="A PIN change request is triggered in settings."/>
  <int value="1" label="A PIN change request is triggered in PIN dialog."/>
  <int value="2" label="GAIA reauth succeeded and a RAPT is retrieved."/>
  <int value="3" label="GAIA reauth is cancelled by closing the window."/>
  <int value="4" label="A new PIN is entered in the GPM PIN dialog."/>
  <int value="5"
      label="Change PIN request is cancelled by dismissing the new PIN
             dialog."/>
  <int value="6" label="Change PIN request succeeded in enclave."/>
  <int value="7"
      label="Change PIN request failed in enclave. This does not include
             cancellations."/>
  <int value="8"
      label="A PIN change request is triggered because the user has no UV"/>
</enum>

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

<enum name="CmtgDeviceKeysResult">
  <int value="0" label="Success"/>
  <int value="1" label="Network error"/>
</enum>

<!-- LINT.ThenChange(//components/webauthn/core/browser/cryptauth_cmtg_device_key_provider.cc:CmtgDeviceKeysResult) -->

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

<enum name="CombinedSelectorAction">
  <int value="0"
      label="Accept button clicked with a single credential available."/>
  <int value="1"
      label="Accept button clicked with the default credential selected."/>
  <int value="2"
      label="Accept button clicked with a non-default credential selected."/>
  <int value="3" label="Cancel button clicked."/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/webauthn_metrics_util.cc:CombinedSelectorAction) -->

<enum name="CredManCreateRequestEnum">
  <int value="0" label="A createCredential request was sent to the platform."/>
  <int value="1"
      label="Unable to sent a createCredential request to the platform."/>
  <int value="2" label="Passkey creation is successful."/>
  <int value="3" label="createCredential request failed."/>
  <int value="4" label="createCredential request cancelled by the user."/>
</enum>

<enum name="CredManGetRequestEnum">
  <int value="0" label="A getCredential request was sent to the platform."/>
  <int value="1"
      label="Unable to sent a getCredential request to the platform."/>
  <int value="2" label="A passkey is received from the getCredential request."/>
  <int value="3"
      label="A password is received from the getCredential request."/>
  <int value="4" label="getCredential request failed."/>
  <int value="5" label="getCredential request cancelled by the user."/>
  <int value="6" label="no credentials found from getCredential request."/>
</enum>

<enum name="CredManPrepareRequestEnum">
  <int value="0"
      label="A prepareGetCredential request was sent to the platform."/>
  <int value="1"
      label="Unable to sent a prepareGetCredential request to the platform."/>
  <int value="2"
      label="prepareGetCredential request succeeded and there are results."/>
  <int value="3"
      label="prepareGetCredential request succeeded but there are no results."/>
  <int value="4" label="prepareGetCredential request failed."/>
</enum>

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

<enum name="DeviceAuthorizationFetchResult">
  <int value="0" label="Success: Keys Fetched"/>
  <int value="1" label="Success: ReAuth Challenge"/>
  <int value="2" label="Error: Network / Transport / OAuth Failure"/>
  <int value="3" label="Error: HTTP Non-200 Status"/>
  <int value="4" label="Error: Proto Parse Failure"/>
  <int value="5" label="Error: Fetch Already In Progress"/>
</enum>

<!-- LINT.ThenChange(//components/webauthn/core/browser/device_authorization/device_authorization_metrics.h:DeviceAuthorizationFetchResultForUMA) -->

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

<enum name="EnclaveManagerActionOutcome">
  <int value="0" label="Success"/>
  <int value="1" label="Generic error"/>
  <int value="2" label="State machine has been destroyed"/>
  <int value="3" label="Action has been cancelled"/>
  <int value="4" label="Error fetching of cert.xml or cert.sig.xml (or both)"/>
  <int value="5" label="Failure of DoGeneratingKeys"/>
  <int value="6" label="Trusted vault registration error"/>
  <int value="7"
      label="Secret wrapping malformed response in DoJoiningPINToDomain"/>
  <int value="8"
      label="Trusted vault registration error in DoJoiningPINToDomain"/>
  <int value="9"
      label="Trusted vault registration error in DoJoiningUpdatedPINToDomain"/>
  <int value="10" label="Renewing PIN while user is not registered"/>
  <int value="11" label="Setting or updating PIN while user is not registered"/>
  <int value="12" label="Enclave registration resulted in error response"/>
  <int value="13" label="Failure of DoRegisteringWithEnclave"/>
  <int value="14"
      label="Wrapped member key was invalid during enclave registration"/>
  <int value="15"
      label="Enclave reports that the cohort is not yet deprecated"/>
  <int value="16" label="PIN renewal resulted in error response"/>
  <int value="17" label="Failure of DoRenewingPIN"/>
  <int value="18"
      label="Parsing wrapped PIN from CBOR failed in DoRenewingPIN"/>
  <int value="19"
      label="Not renewing PIN because it would result in downgrading the
             recovery store"/>
  <int value="20"
      label="Can not parse wrapped PIN from an enclave CBOR response in
             DoSettingPIN"/>
  <int value="21" label="Failure of DoSettingPIN"/>
  <int value="22" label="PIN change resulted in error response"/>
  <int value="23"
      label="No system UV and no GPM PIN during out-of-context retrieval"/>
  <int value="24"
      label="Problem while parsing wrapped PIN during out-of-context
             retrieval"/>
  <int value="25" label="Already has pin in DoSyncingWithSecurityDomain"/>
  <int value="26" label="The security domain has been reset"/>
  <int value="27" label="Tried to change the PIN, but SDS reports no PIN"/>
  <int value="28"
      label="Downloading authentication factors registration state resulted
             in error"/>
  <int value="29" label="Unregister request resulted in error response"/>
  <int value="30" label="Failure of DoUnregistering"/>
  <int value="31"
      label="Failed to get access token for enclave in
             DoWaitingForEnclaveTokenForPINWrapping"/>
  <int value="32"
      label="Failed to get access token for enclave in
             DoWaitingForEnclaveTokenForRegistration"/>
  <int value="33"
      label="Failed to get access token for enclave in
             DoWaitingForEnclaveTokenForUnregister"/>
  <int value="34"
      label="Failed to get access token for enclave in
             DoWaitingForEnclaveTokenForWrapping"/>
  <int value="35" label="Failed to upload to recovery key store"/>
  <int value="36" label="PIN wrapping resulted in error response"/>
  <int value="37" label="Failure of DoWrappingPINAndSecret"/>
  <int value="38"
      label="Failed to translate response into an UpdateVaultProto"/>
  <int value="39" label="Failed to store wrapped secrets"/>
  <int value="40" label="Failed to wrap security domain secrets"/>
  <int value="41" label="Secrets wrapping resulted in error response"/>
  <int value="42" label="Enclave response was not a map"/>
  <int value="43"
      label="Can not parse a vault and security domain member keys from a
             CBOR map"/>
  <int value="44" label="Account mismatch in DoNextAction"/>
  <int value="45"
      label="Failed to parse wrapped PIN or PIN invariants check failed in
             AddDeviceToAccount"/>
  <int value="46"
      label="Failed to parse wrapped PIN or PIN invariants check failed in
             ConsiderSecurityDomainState"/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/enclave_manager.h:EnclaveManagerActionOutcome) -->

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

<enum name="GmsCoreGetCredentialsResult">
  <int value="0" label="CacheSuccess">
    The passkey cache service returned credentials successfully.
  </int>
  <int value="1" label="CacheFailureFallbackSuccess">
    The passkey cache service failed, but the fallback to the FIDO2 API
    succeeded.
  </int>
  <int value="2" label="CacheFailureFallbackFailure">
    The passkey cache service failed, and the fallback to the FIDO2 API also
    failed.
  </int>
  <int value="3" label="Fido2Success">
    The FIDO2 API was used directly and succeeded.
  </int>
  <int value="4" label="Fido2Failure">
    The FIDO2 API was used directly and failed.
  </int>
</enum>

<!-- LINT.ThenChange(//components/webauthn/android/java/src/org/chromium/components/webauthn/GmsCoreGetCredentialsHelper.java:GmsCoreGetCredentialsResult) -->

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

<enum name="GmsCoreSkippedCacheReason">
  <int value="0" label="GoogleRp">The request is for a Google passkey.</int>
  <int value="1" label="PaymentRequest">
    The request is associated with payments.
  </int>
  <int value="2" label="ModalAllowListRequest">
    This is a modal WebAuthn request with an allow list.
  </int>
  <int value="3" label="(obsolete) FeatureDisabled">
    Use of the metadata cache is disabled in Chrome. Removed in M144.
  </int>
  <int value="4" label="OldGmsCoreVersion">
    The current GMS Core version does not support the metadata cache.
  </int>
</enum>

<!-- LINT.ThenChange(//components/webauthn/android/java/src/org/chromium/components/webauthn/GmsCoreGetCredentialsHelper.java:GmsCoreSkippedCacheReason) -->

<enum name="GPMGetAssertionEvents">
  <int value="0" label="Started - GPM passkey selected"/>
  <int value="1" label="Success - Authentication complete"/>
  <int value="2" label="Failure - Error dialog shown"/>
</enum>

<enum name="GPMMakeCredentialEvents">
  <int value="0" label="Started - Create GPM passkey dialog shown"/>
  <int value="1" label="Success - Passkey saved"/>
  <int value="2" label="Failure - Error dialog shown"/>
</enum>

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

<enum name="GpmPinAvailability">
  <int value="0" label="The PIN is set but not usable."/>
  <int value="1" label="The PIN is set and usable."/>
  <int value="2" label="The PIN is unset."/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/enclave_manager_interface.h:GpmPinAvailability) -->

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

<enum name="ImportedPasskeyStatus">
  <int value="0" label="Ok"/>
  <int value="1" label="Credential ID too short"/>
  <int value="2" label="Credential ID too long"/>
  <int value="3" label="User ID too long"/>
  <int value="4" label="Private key missing"/>
  <int value="5" label="RP ID missing"/>
  <int value="6" label="Private key invalid"/>
  <int value="7" label="Private key unsupported algorithm"/>
  <int value="8" label="Encryption failed"/>
  <int value="9" label="HMAC secret invalid size"/>
  <int value="10" label="HMAC secret unsupported algorithm"/>
  <int value="11" label="Large blob required fields missing"/>
  <int value="12" label="Large blob compressed size too big"/>
  <int value="13" label="Large blob uncompressed size too big"/>
</enum>

<!-- LINT.ThenChange(//components/webauthn/core/browser/import/imported_passkey_checker.h:ImportedPasskeyStatus) -->

<enum name="OnboardingEvents">
  <int value="0" label="Started (Create GPM passkey dialog shown)"/>
  <int value="1" label="Succeeded (GPM passkey created)"/>
  <int value="2" label="Cancelled - Passkey creation - Cancel"/>
  <int value="3" label="Cancelled - Passkey creation - Save another way"/>
  <int value="4" label="Cancelled - PIN create modal"/>
  <int value="5" label="Failure dialog shown"/>
</enum>

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

<enum name="PasskeyUpgradeResult">
  <int value="0" label="Success"/>
  <int value="1" label="GPM disabled"/>
  <int value="2" label="Passkey upgrades disabled"/>
  <int value="3" label="GPM Enclave not initialized"/>
  <int value="4" label="Password store error"/>
  <int value="5" label="No password with matching username found"/>
  <int value="6" label="Matching password was not recently used"/>
  <int value="7" label="GPM Enclave error"/>
  <int value="8" label="Security domain state is stale"/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/ui/webauthn/passkey_upgrade_request_controller.h:PasskeyUpgradeResult) -->

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

<enum name="SignalAllAcceptedCredentialsResult">
  <int value="0" label="No passkeys were changed"/>
  <int value="1" label="A passkey was removed"/>
  <int value="2" label="A passkey was hidden"/>
  <int value="3" label="A passkey was restored"/>
  <int value="4"
      label="The website exceeded the quota, so the request was dropped."/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/chrome_web_authentication_delegate.h:SignalAllAcceptedCredentialsResult) -->

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

<enum name="SignalCurrentUserDetailsResult">
  <int value="0"
      label="The website exceeded the quota, so the request was dropped."/>
  <int value="1"
      label="A passkey matching the user ID was found and had changed, so it
             was updated."/>
  <int value="2" label="No passkeys were updated."/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/chrome_web_authentication_delegate.h:SignalCurrentUserDetailsResult) -->

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

<enum name="SignalUnknownCredentialResult">
  <int value="0" label="The passkey ID was not found, so nothing was removed."/>
  <int value="1" label="The passkey ID was found and removed."/>
  <int value="2" label="The passkey ID was found and hidden."/>
  <int value="3"
      label="The website exceeded the quota, so the request was dropped."/>
  <int value="4" label="The passkey ID was already hidden."/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/chrome_web_authentication_delegate.h:SignalUnknownCredentialResult) -->

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

<enum name="U2fSignOperationResult">
  <int value="0" label="Operation succeeded"/>
  <int value="1" label="Operation was cancelled"/>
  <int value="2" label="User had no credentials"/>
  <int value="3" label="An unrecoverable error occurred"/>
  <int value="4" label="An error occurred, then the operation succeeded"/>
  <int value="5" label="An error occurred, then the operation was cancelled"/>
  <int value="6" label="An error occurred, then the user had no credentials"/>
  <int value="7" label="An error occurred, then a fatal error occurred"/>
</enum>

<!-- LINT.ThenChange(//device/fido/u2f_sign_operation.cc:U2fSignOperationResult) -->

<enum name="WebAuthenticationCableV2TunnelEvent">
  <int value="0"
      label="Tunnel attempt started for QR- or extension-based connection"/>
  <int value="1" label="Tunnel attempt started for linked connected"/>
  <int value="2" label="Tunnel connected"/>
  <int value="3" label="Contact ID was invalid"/>
  <int value="4" label="Tunnel failed with unexpected HTTP 410 status"/>
  <int value="5" label="Tunnel failed"/>
  <int value="6" label="Handshake failed"/>
  <int value="7" label="Error processing post-handshake message"/>
  <int value="8" label="Tunnel established"/>
  <int value="9" label="Failed to decrypt main-flow message"/>
</enum>

<enum name="WebAuthenticationChromeOSGetAssertionResult">
  <int value="0" label="Unknown"/>
  <int value="1" label="Success"/>
  <int value="2" label="Verification failed"/>
  <int value="3" label="Verification timeout"/>
  <int value="4" label="Invalid request"/>
  <int value="5" label="Internal error"/>
  <int value="6" label="No credential id matched"/>
  <int value="7" label="Another request pending"/>
  <int value="8" label="Canceled"/>
</enum>

<enum name="WebAuthenticationChromeOSMakeCredentialResult">
  <int value="0" label="Unknown"/>
  <int value="1" label="Success"/>
  <int value="2" label="Verification failed"/>
  <int value="3" label="Verification timeout"/>
  <int value="4" label="Invalid request"/>
  <int value="5" label="Internal error"/>
  <int value="6" label="Excluded credential id matched"/>
  <int value="7" label="Another request pending"/>
  <int value="8" label="Canceled"/>
</enum>

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

<enum name="WebAuthenticationCredentialRequestResult">
  <int value="0" label="Timeout"/>
  <int value="1" label="User cancelled"/>
  <int value="2" label="Native Windows API success"/>
  <int value="3" label="Native Windows API error"/>
  <int value="4" label="Chrome TouchID authenticator success"/>
  <int value="5" label="Chrome TouchID authenticator failure"/>
  <int value="6" label="ChromeOS platform authenticator success"/>
  <int value="7" label="ChromeOS platform authenticator failure"/>
  <int value="8" label="Phone success"/>
  <int value="9" label="Phone failure"/>
  <int value="10" label="iCloud keychain success"/>
  <int value="11" label="iCloud keychain failure"/>
  <int value="12" label="Enclave success"/>
  <int value="13" label="Enclave failure"/>
  <int value="14" label="Other device success"/>
  <int value="15" label="Other device error"/>
  <int value="16" label="Android FIDO2 success"/>
  <int value="17" label="Android FIDO2 error"/>
  <int value="18" label="Android CredMan success"/>
  <int value="19" label="Android CredMan error"/>
  <int value="20" label="Android FIDO2 hybrid success"/>
  <int value="21" label="Android FIDO2 hybrid error"/>
  <int value="22" label="Android FIDO2 legacy success"/>
  <int value="23" label="Android FIDO2 legacy error"/>
  <int value="24" label="Android Identity Credentials Module success"/>
  <int value="25" label="Android Identity Credentials Module error"/>
</enum>

<!-- LINT.ThenChange(//content/browser/webauth/authenticator_request_outcome_enums.h:CredentialRequestResult) -->

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

<enum name="WebAuthenticationDeduplicatedType">
  <int value="0" label="Google Password Manager Passkey"/>
  <int value="1" label="Platform Passkey"/>
  <int value="2" label="Password"/>
  <int value="3" label="Other"/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/credential_sorter.h:WebAuthnDeduplicatedType) -->

<enum name="WebAuthenticationEnclaveEvent">
  <int value="0" label="Onboarding sheet was shown to the user"/>
  <int value="1"
      label="User rejected the onboarding sheet by requesting to save the
             passkey in a different authenticator"/>
  <int value="2" label="User accepted the onboarding sheet"/>
  <int value="3" label="A MagicArch window was shown"/>
  <int value="4" label="MagicArch provided the security domain secret"/>
  <int value="5" label="A create() request was sent to the enclave"/>
  <int value="6" label="A get() request was sent to the enclave"/>
  <int value="7"
      label="The enclave create passkey dialog was shown as the priority
             mechanism"/>
  <int value="8"
      label="User backed out of create passkey priority mechanism screen"/>
  <int value="9" label="User recovered from an iCloud Keychain recovery key"/>
  <int value="10" label="Downloading the account state timed out"/>
  <int value="11"
      label="Recoverable sign in error, user needs to reauth to use the
             enclave"/>
  <int value="12"
      label="The enclave was the default but loading took too long, so Chrome
             jumped to the mechanism selection screen instead"/>
</enum>

<enum name="WebAuthenticationEnclaveRequestResult">
  <int value="0" label="Success"/>
  <int value="1" label="No Supported Algorithm"/>
  <int value="2" label="Duplicate"/>
  <int value="3" label="Incorrect PIN"/>
  <int value="4" label="PIN Locked"/>
  <int value="5" label="PIN Outdated"/>
  <int value="6" label="Recovery Key Store Downgrade"/>
  <int value="7" label="Failed Transaction"/>
  <int value="8" label="Other Error"/>
  <int value="9" label="Cohort not yet deprecated"/>
</enum>

<enum name="WebAuthenticationEnclaveTransactionResult">
  <int value="0" label="Success"/>
  <int value="1" label="Unknown Client Error"/>
  <int value="2" label="Missing Public Key Error"/>
  <int value="3" label="Service Failed To Verify Signature"/>
  <int value="4" label="Handshake Failed"/>
  <int value="5" label="Decryption Of Server Response Failed"/>
  <int value="6" label="Failed To Parse Server Response"/>
  <int value="7" label="Other Error"/>
  <int value="8" label="WebSocket Error"/>
</enum>

<enum name="WebAuthenticationFidoTransport">
  <int value="0" label="USB HID"/>
  <int value="1" label="Near Field Communication"/>
  <int value="2" label="Bluetooth Low Energy"/>
  <int value="3" label="Cloud-assisted BLE"/>
  <int value="4" label="Internal"/>
  <int value="5" label="Android Accessory (Deprecated)"/>
  <int value="6" label="Smart Card"/>
</enum>

<enum name="WebAuthenticationGetAssertionOutcome">
  <int value="0" label="Success"/>
  <int value="1" label="Security Error"/>
  <int value="2" label="User Cancellation"/>
  <int value="3" label="Credential Not Recognized"/>
  <int value="4" label="Invalid Response From Authenticator"/>
  <int value="5" label="RK Not Supported"/>
  <int value="6" label="UV Not Supported"/>
  <int value="7" label="Soft PIN Block"/>
  <int value="8" label="Hard PIN Block"/>
  <int value="9" label="Platform Not Allowed Error"/>
  <int value="10" label="Hybrid Transport Error"/>
  <int value="11" label="Blocked By Filter"/>
  <int value="12" label="Enclave Authenticator Error"/>
  <int value="13" label="Timeout Occurred"/>
  <int value="14" label="Other Failure"/>
  <int value="15" label="Blocked by actor task"/>
  <int value="16" label="Cross Device Fallback"/>
</enum>

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

<enum name="WebAuthenticationGPMCachedOpportunisticallyRetrievedKeyEvent">
  <int value="0"
      label="The temporarily cached key from the opportunistic key retrieval
             flow has been discarded after timeout"/>
  <int value="1"
      label="Storing the temporarily cached key from the opportunistic key
             retrieval flow after profile signed-in"/>
  <int value="2"
      label="The temporarily cached key from the opportunistic key retrieval
             has been overwritten by some other opportunistically retrieved
             key"/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/webauthn_metrics_util.h:WebAuthenticationGPMCachedOpportunisticallyRetrievedKeyEvent) -->

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

<enum name="WebAuthenticationGPMRecoveryEvent">
  <int value="0"
      label="Storing key from explicit key retrieval flow (started)"/>
  <int value="1"
      label="Storing key from explicit key retrieval flow (succeeded)"/>
  <int value="2"
      label="Storing key from opportunistic key retrieval flow (started)"/>
  <int value="3"
      label="Storing key from opportunistic key retrieval flow (succeeded)"/>
  <int value="4"
      label="Storing key from opportunistic key retrieval flow (key ignored
             because it is redundant)"/>
  <int value="5"
      label="Storing key from opportunistic key retrieval flow (key ignored
             because no UV available). Deprecated."/>
  <int value="6"
      label="Storing key from opportunistic key retrieval flow (failed when
             adding device to account)"/>
  <int value="7"
      label="Key from the opportunistic key retrieval flow has been
             temporarily cached because profile is not signed-in or the
             primary account does not match"/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/webauthn_metrics_util.h:WebAuthenticationGPMRecoveryEvent) -->

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

<enum name="WebAuthenticationImmediateMediationRejectionReason">
  <int value="0" label="Incognito"/>
  <int value="1" label="RateLimited"/>
  <int value="2" label="NoCredentials"/>
  <int value="3" label="Timeout"/>
</enum>

<!-- LINT.ThenChange(//content/public/browser/authenticator_request_client_delegate.h:ImmediateMediationRejectionReason) -->

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

<enum name="WebAuthenticationIOSContentAreaEvent">
  <int value="0" label="GetRequested">
    Page requested a WebAuthn credential using the navigator.credentials.get
    API.
  </int>
  <int value="1" label="CreateRequested">
    Page requested a new WebAuthn credential using the
    navigator.credentials.create API.
  </int>
  <int value="2" label="GetResolvedGpm">
    WebAuthn credential get request was successfully resolved with Google
    Password Manager as an authenticator.
  </int>
  <int value="3" label="GetResolvedNonGpm">
    WebAuthn credential get request was successfully resolved with different
    authenticator than Google Password Manager.
  </int>
  <int value="4" label="CreateResolvedGpm">
    WebAuthn credential create request was successfully resolved with Google
    Password Manager as an authenticator.
  </int>
  <int value="5" label="CreateResolvedNonGpm">
    WebAuthn credential create request was successfully resolved with different
    authenticator than Google Password Manager.
  </int>
  <int value="6" label="IncognitoInterstitialShown">
    The Incognito interstitial warning was shown to the user during passkey
    creation.
  </int>
  <int value="7" label="CancelRequested">
    Page cancelled a WebAuthn credential request via an AbortSignal.
  </int>
  <int value="8" label="SignalUnknownCredentialRequested">
    Page requested a WebAuthn signalUnknownCredential call.
  </int>
  <int value="9" label="SignalCurrentUserDetailsRequested">
    Page requested a WebAuthn signalCurrentUserDetails call.
  </int>
  <int value="10" label="SignalAllAcceptedCredentialsRequested">
    Page requested a WebAuthn signalAllAcceptedCredentials call.
  </int>
</enum>

<!-- LINT.ThenChange(//components/webauthn/ios/passkey_tab_helper.h) -->

<enum name="WebAuthenticationMacOSPasskeysPermission">
  <int value="0" label="Requested permission during a create() call"/>
  <int value="1" label="Permission approved during a create() call"/>
  <int value="2" label="Permission denied during a create() call"/>
  <int value="3" label="Requested permission during a get() call"/>
  <int value="4" label="Permission approved during a get() call"/>
  <int value="5" label="Permission denied during a get() call"/>
</enum>

<enum name="WebAuthenticationMacOSPlatformAuthenticatorAction">
  <int value="0"
      label="Started create() for profile authenticator with iCloud Drive
             enabled"/>
  <int value="1"
      label="Started create() for profile authenticator with iCloud Drive
             disabled"/>
  <int value="2"
      label="Started create() for iCloud Keychain with iCloud Drive enabled"/>
  <int value="3"
      label="Started create() for iCloud Keychain with iCloud Drive disabled"/>
  <int value="4"
      label="Successful create() for profile authenticator with iCloud Drive
             enabled"/>
  <int value="5"
      label="Successful create() for profile authenticator with iCloud Drive
             disabled"/>
  <int value="6"
      label="Successful create() for iCloud Keychain with iCloud Drive
             enabled"/>
  <int value="7"
      label="Successful create() for iCloud Keychain with iCloud Drive
             disabled"/>
  <int value="8"
      label="Started get() where the profile authenticator recognised a
             credential"/>
  <int value="9"
      label="Started get() where iCloud Keychain recognised a credential"/>
  <int value="10"
      label="Started get() where both the profile authenticator and iCloud
             Keychain recognised a credential"/>
  <int value="11" label="Successful get() from the profile authenticator"/>
  <int value="12" label="Successful get() from iCloud Keychain"/>
</enum>

<enum name="WebAuthenticationMakeCredentialOutcome">
  <int value="0" label="Success"/>
  <int value="1" label="Security Error"/>
  <int value="2" label="User Cancellation"/>
  <int value="3" label="Credential Excluded"/>
  <int value="4" label="Invalid Response From Authenticator"/>
  <int value="5" label="RK Not Supported"/>
  <int value="6" label="UV Not Supported"/>
  <int value="7" label="Large Blob Not Supported"/>
  <int value="8" label="Algorithm Not Supported"/>
  <int value="9" label="Soft PIN Block"/>
  <int value="10" label="Hard PIN Block"/>
  <int value="11" label="Storage Full"/>
  <int value="12" label="Platform Not Allowed Error"/>
  <int value="13" label="Hybrid Transport Error"/>
  <int value="14" label="Blocked By Filter"/>
  <int value="15" label="Enclave Authenticator Error"/>
  <int value="16" label="Timeout Occurred"/>
  <int value="17" label="Other Failure"/>
  <int value="18" label="Conditional Create (Passkey Upgrade) Failure"/>
  <int value="19" label="Blocked by actor task"/>
</enum>

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

<enum name="WebAuthenticationPasskeyUnlockErrorUiEvent">
  <int value="0" label="Avatar Error UI Displayed"/>
  <int value="1" label="Avatar Error UI Hidden"/>
  <int value="2" label="Avatar Button with Error UI Pressed"/>
</enum>

<!-- LINT.ThenChange(//chrome/browser/webauthn/passkey_unlock_manager.h:ErrorUIEventType) -->

<enum name="WebAuthenticationPinRenewalEvent">
  <int value="0" label="Considered renewing the PIN"/>
  <int value="1" label="No PIN to renew"/>
  <int value="2" label="Another renewal was running concurrently"/>
  <int value="3" label="Not yet time to renew"/>
  <int value="4" label="Started renewal"/>
  <int value="5" label="Successful renewal"/>
  <int value="6" label="Renewal failed"/>
</enum>

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

<enum name="WebAuthenticationRequestMode">
  <int value="0" label="WebAuthn Modal Request"/>
  <int value="1" label="WebAuthn Conditional UI Request"/>
  <int value="2" label="Payment Request"/>
  <int value="3" label="WebAuthn Passkey Upgrade Request"/>
  <int value="4" label="WebAuthn Immediate Get Request"/>
</enum>

<!-- LINT.ThenChange(//content/browser/webauth/authenticator_request_outcome_enums.h:AuthenticationRequestMode) -->

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

<enum name="WebAuthenticationResidentKeyRequirement">
  <int value="0" label="Unspecified"/>
  <int value="1" label="residentKey Discouraged"/>
  <int value="2" label="residentKey Preferred"/>
  <int value="3" label="residentKey Required"/>
  <int value="4" label="requireResidentKey True"/>
  <int value="5" label="requireResidentKey False"/>
  <int value="6" label="residentKey provided with an unknown value"/>
</enum>

<!-- LINT.ThenChange(//third_party/blink/renderer/modules/credentialmanagement/authentication_credentials_container.cc:WebAuthenticationResidentKeyRequirement) -->

<enum name="WindowsForegroundedHelloDialog">
  <int value="0" label="Succeeded"/>
  <int value="1" label="SetForegroundWindow failed"/>
  <int value="2" label="Window not found"/>
  <int value="3" label="Polling cancelled before finding window"/>
</enum>

<enum name="WindowsKeyCredentialCreateResult">
  <int value="0" label="Operation succeeded"/>
  <int value="1" label="System operation returned an error"/>
  <int value="2" label="ActivationFactory Not Available"/>
  <int value="3" label="RequestCreateAsync Call Failed"/>
  <int value="4" label="PostAsyncHandlers Call Failed"/>
  <int value="5" label="Invalid status returned"/>
  <int value="6" label="Invalid result returned"/>
  <int value="7" label="Invalid credential returned"/>
</enum>

<enum name="WindowsKeyCredentialManagerSupportResults">
  <int value="0" label="KeyCredentialManager Available"/>
  <int value="1" label="KeyCredentialManager Not Available"/>
  <int value="2" label="ActivationFactory Not Available"/>
  <int value="3" label="IsSupportedAsync Call Failed"/>
  <int value="4" label="PostAsyncHandlers Call Failed"/>
  <int value="5" label="Async Operation Failed"/>
</enum>

<enum name="WindowsKeyCredentialSignResult">
  <int value="0" label="Operation succeeded"/>
  <int value="1" label="System operation returned an error"/>
  <int value="2" label="RequestSignAsync call failed"/>
  <int value="3" label="PostAsyncHandlers call failed"/>
  <int value="4" label="IBuffer creation failed"/>
  <int value="5" label="Invalid status returned"/>
  <int value="6" label="Invalid result returned"/>
  <int value="7" label="Invalid signature buffer returned"/>
</enum>

</enums>

</histogram-configuration>
