#include "components/autofill/core/browser/autofill_profile_import_process.h"
#include <map>
#include "base/check_deref.h"
#include "base/feature_list.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/address_data_cleaner.h"
#include "components/autofill/core/browser/address_data_manager.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/autofill_profile_comparator.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/metrics/profile_deduplication_metrics.h"
#include "components/autofill/core/browser/metrics/profile_import_metrics.h"
#include "components/autofill/core/browser/profile_requirement_utils.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_features.h"
namespace autofill {
namespace {
UserDecision;
bool ShouldCountryApproximationBeRemoved(
const AutofillProfile& profile,
const std::vector<const AutofillProfile*>& existing_profiles,
const AutofillProfileComparator& comparator) { … }
}
ProfileImportMetadata::ProfileImportMetadata() = default;
ProfileImportMetadata::ProfileImportMetadata(const ProfileImportMetadata&) =
default;
ProfileImportMetadata::~ProfileImportMetadata() = default;
ProfileImportProcess::ProfileImportProcess(
const AutofillProfile& observed_profile,
const std::string& app_locale,
const GURL& form_source_url,
AddressDataManager* address_data_manager,
bool allow_only_silent_updates,
ProfileImportMetadata import_metadata)
: … { … }
ProfileImportProcess::ProfileImportProcess(const ProfileImportProcess&) =
default;
ProfileImportProcess& ProfileImportProcess::operator=(
const ProfileImportProcess& other) = default;
ProfileImportProcess::~ProfileImportProcess() = default;
bool ProfileImportProcess::prompt_shown() const { … }
bool ProfileImportProcess::UserDeclined() const { … }
bool ProfileImportProcess::UserAccepted() const { … }
void ProfileImportProcess::DetermineProfileImportType() { … }
void ProfileImportProcess::DetermineSourceOfImportCandidate() { … }
bool ProfileImportProcess::IsObservedProfileAutofilledQuasiDuplicate(
const AutofillProfileComparator& comparator) { … }
void ProfileImportProcess::MaybeSetMigrationCandidate(
std::optional<AutofillProfile>& migration_candidate,
const AutofillProfile& profile) const { … }
void ProfileImportProcess::ApplyImport() { … }
void ProfileImportProcess::SetUserDecision(
UserDecision decision,
base::optional_ref<const AutofillProfile> edited_profile) { … }
void ProfileImportProcess::AcceptWithoutPrompt() { … }
void ProfileImportProcess::AcceptWithoutEdits() { … }
void ProfileImportProcess::AcceptWithEdits(AutofillProfile edited_profile) { … }
void ProfileImportProcess::Declined() { … }
void ProfileImportProcess::Ignore() { … }
bool ProfileImportProcess::ProfilesChanged() const { … }
void ProfileImportProcess::set_prompt_was_shown() { … }
void ProfileImportProcess::CollectMetrics(
ukm::UkmRecorder* ukm_recorder,
ukm::SourceId source_id,
const std::vector<const AutofillProfile*>& existing_profiles) const { … }
int ProfileImportProcess::CollectedEditedTypeHistograms() const { … }
}