chromium/components/autofill/core/browser/autofill_profile_import_process.cc

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

#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;

// When the profile is observed without explicit country information, Autofill
// guesses it's country. Detecting a profile as a duplicate can fail if we guess
// incorrectly. This function checks if we have reason to believe that the
// country of `profile` was guessed incorrectly. It does so by checking whether
// any of the `existing_profiles` becomes mergeable after removing the country
// of `profile`.
// Comparisons are done using `comparator`. Note that for two countries to be
// mergeable, they must share the same address model.
bool ShouldCountryApproximationBeRemoved(
    const AutofillProfile& profile,
    const std::vector<const AutofillProfile*>& existing_profiles,
    const AutofillProfileComparator& comparator) {}

}  // namespace

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 {}

}  // namespace autofill