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

// Copyright 2020 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/address_data_cleaner.h"

#include "base/containers/to_vector.h"
#include "base/notreached.h"
#include "base/ranges/algorithm.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/address_data_cleaner_metrics.h"
#include "components/autofill/core/browser/metrics/autofill_metrics_utils.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/profile_token_quality.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_constants.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "components/prefs/pref_service.h"
#include "components/sync/base/user_selectable_type.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_user_settings.h"

namespace autofill {

namespace {

DifferingProfileWithTypeSet;

// Determines whether cleanups should be deferred because the latest data wasn't
// synced down yet.
bool ShouldWaitForSync(syncer::SyncService* sync_service) {}

// Quasi duplicates of rank one, those conflicting token has low quality qualify
// for silent removal.
bool IsSilentlyRemovableQuasiDuplicate(
    const AutofillProfile& profile,
    const std::vector<AutofillProfile>& other_profiles,
    const AutofillProfileComparator& comparator) {}

// - Merges local profiles occurring earlier in `profiles` with mergeable other
//   local profiles later in `profiles`, deleting the earlier one.
// - Deletes local profiles that are subsets of account profiles.
// Mergability is determined using `comparator`.
void DeduplicateProfiles(const AutofillProfileComparator& comparator,
                         std::vector<AutofillProfile> profiles,
                         AddressDataManager& adm) {}

template <typename T, typename Proj>
std::vector<T> CalculateMinimalIncompatibleTypeSetsImpl(
    const AutofillProfile& profile,
    base::span<const AutofillProfile* const> other_profiles,
    const AutofillProfileComparator& comparator,
    Proj proj) {}

}  // namespace

AddressDataCleaner::AddressDataCleaner(
    AddressDataManager& address_data_manager,
    syncer::SyncService* sync_service,
    PrefService& pref_service,
    AlternativeStateNameMapUpdater* alternative_state_name_map_updater)
    :{}

AddressDataCleaner::~AddressDataCleaner() = default;

void AddressDataCleaner::MaybeCleanupAddressData() {}

// static
std::vector<FieldTypeSet>
AddressDataCleaner::CalculateMinimalIncompatibleTypeSets(
    const AutofillProfile& profile,
    base::span<const AutofillProfile> other_profiles,
    const AutofillProfileComparator& comparator) {}

// static
std::vector<FieldTypeSet>
AddressDataCleaner::CalculateMinimalIncompatibleTypeSets(
    const AutofillProfile& profile,
    base::span<const AutofillProfile* const> existing_profiles,
    const AutofillProfileComparator& comparator) {}

// static
std::vector<DifferingProfileWithTypeSet>
AddressDataCleaner::CalculateMinimalIncompatibleProfileWithTypeSets(
    const AutofillProfile& profile,
    base::span<const AutofillProfile* const> existing_profiles,
    const AutofillProfileComparator& comparator) {}

// static
bool AddressDataCleaner::IsTokenLowQualityForDeduplicationPurposes(
    const AutofillProfile& profile,
    FieldType type) {}

// static
std::pair<size_t, size_t>
AddressDataCleaner::CountObservationsByQualityForDeduplicationPurposes(
    base::span<const ProfileTokenQuality::ObservationType> observations) {}

void AddressDataCleaner::ApplyDeduplicationRoutine() {}

void AddressDataCleaner::DeleteDisusedAddresses() {}

void AddressDataCleaner::OnAddressDataChanged() {}

void AddressDataCleaner::OnStateChanged(syncer::SyncService* sync_service) {}

}  // namespace autofill