#include "chrome/browser/extensions/api/autofill_private/autofill_private_api.h"
#include <stddef.h>
#include <algorithm>
#include <optional>
#include <string_view>
#include <utility>
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/utf_string_conversions.h"
#include "base/uuid.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/autofill_private/autofill_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/autofill_private.h"
#include "components/autofill/content/browser/content_autofill_client.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
#include "components/autofill/core/browser/address_data_manager.h"
#include "components/autofill/core/browser/autofill_address_util.h"
#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/browser_autofill_manager.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/data_model/iban.h"
#include "components/autofill/core/browser/form_data_importer.h"
#include "components/autofill/core/browser/metrics/address_save_metrics.h"
#include "components/autofill/core/browser/metrics/payments/mandatory_reauth_metrics.h"
#include "components/autofill/core/browser/payments/credit_card_access_manager.h"
#include "components/autofill/core/browser/payments/local_card_migration_manager.h"
#include "components/autofill/core/browser/payments/mandatory_reauth_manager.h"
#include "components/autofill/core/browser/payments/payments_autofill_client.h"
#include "components/autofill/core/browser/payments/virtual_card_enrollment_flow.h"
#include "components/autofill/core/browser/payments/virtual_card_enrollment_manager.h"
#include "components/autofill/core/browser/payments_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "components/strings/grit/components_branded_strings.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/extension_function_registry.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui_component.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/localization.h"
#include "ui/base/l10n/l10n_util.h"
autofill_private;
addressinput;
LogMandatoryReauthOptInOrOutUpdateEvent;
LogMandatoryReauthSettingsPageEditCardEvent;
MandatoryReauthAuthenticationFlowEvent;
MandatoryReauthOptInOrOutSource;
namespace {
static const char kSettingsOrigin[] = …;
static const char kErrorCardDataUnavailable[] = …;
static const char kErrorDataUnavailable[] = …;
static const char kErrorDeviceAuthUnavailable[] = …;
constexpr auto kUserVerified = …;
constexpr char kFieldTypeKey[] = …;
constexpr char kFieldLengthKey[] = …;
constexpr char kFieldNameKey[] = …;
constexpr char kFieldRequired[] = …;
base::Value::Dict AddressUiComponentAsValueMap(
const autofill::AutofillAddressUIComponent& address_ui_component) { … }
autofill::BrowserAutofillManager* GetBrowserAutofillManager(
content::WebContents* web_contents) { … }
autofill::AutofillProfile CreateNewAutofillProfile(
autofill::PersonalDataManager* personal_data,
std::optional<std::string_view> country_code) { … }
}
namespace extensions {
ExtensionFunction::ResponseAction AutofillPrivateGetAccountInfoFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateSaveAddressFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateGetCountryListFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateGetAddressComponentsFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateGetAddressListFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateSaveCreditCardFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateRemoveEntryFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateGetCreditCardListFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateMigrateCreditCardsFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateLogServerCardLinkClickedFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateLogServerIbanLinkClickedFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateSaveIbanFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateGetIbanListFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateIsValidIbanFunction::Run() { … }
ExtensionFunction::ResponseAction AutofillPrivateAddVirtualCardFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateRemoveVirtualCardFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateAuthenticateUserAndFlipMandatoryAuthToggleFunction::Run() { … }
void AutofillPrivateAuthenticateUserAndFlipMandatoryAuthToggleFunction::
UpdateMandatoryAuthTogglePref(bool reauth_succeeded) { … }
ExtensionFunction::ResponseAction AutofillPrivateGetLocalCardFunction::Run() { … }
void AutofillPrivateGetLocalCardFunction::OnReauthFinished(bool can_retrieve) { … }
void AutofillPrivateGetLocalCardFunction::ReturnCreditCard() { … }
ExtensionFunction::ResponseAction
AutofillPrivateCheckIfDeviceAuthAvailableFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateBulkDeleteAllCvcsFunction::Run() { … }
ExtensionFunction::ResponseAction
AutofillPrivateSetAutofillSyncToggleEnabledFunction::Run() { … }
}