#include "components/autofill/core/browser/webdata/payments/autofill_wallet_offer_sync_bridge.h"
#include <utility>
#include "base/base64.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "components/autofill/core/browser/data_model/autofill_offer_data.h"
#include "components/autofill/core/browser/metrics/autofill_metrics.h"
#include "components/autofill/core/browser/metrics/payments/offers_metrics.h"
#include "components/autofill/core/browser/webdata/autofill_sync_metadata_table.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_backend.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/browser/webdata/payments/payments_autofill_table.h"
#include "components/autofill/core/browser/webdata/payments/payments_sync_bridge_util.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/hash_util.h"
#include "components/sync/model/client_tag_based_data_type_processor.h"
#include "components/sync/model/mutable_data_batch.h"
#include "components/sync/model/sync_metadata_store_change_list.h"
namespace autofill {
namespace {
static int kAutofillWalletOfferSyncBridgeUserDataKey = …;
std::string GetClientTagFromSpecifics(
const sync_pb::AutofillOfferSpecifics& specifics) { … }
std::string GetStorageKeyFromSpecifics(
const sync_pb::AutofillOfferSpecifics& specifics) { … }
}
void AutofillWalletOfferSyncBridge::CreateForWebDataServiceAndBackend(
AutofillWebDataBackend* web_data_backend,
AutofillWebDataService* web_data_service) { … }
syncer::DataTypeSyncBridge* AutofillWalletOfferSyncBridge::FromWebDataService(
AutofillWebDataService* web_data_service) { … }
AutofillWalletOfferSyncBridge::AutofillWalletOfferSyncBridge(
std::unique_ptr<syncer::DataTypeLocalChangeProcessor> change_processor,
AutofillWebDataBackend* web_data_backend)
: … { … }
AutofillWalletOfferSyncBridge::~AutofillWalletOfferSyncBridge() { … }
std::unique_ptr<syncer::MetadataChangeList>
AutofillWalletOfferSyncBridge::CreateMetadataChangeList() { … }
std::optional<syncer::ModelError>
AutofillWalletOfferSyncBridge::MergeFullSyncData(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList entity_data) { … }
std::optional<syncer::ModelError>
AutofillWalletOfferSyncBridge::ApplyIncrementalSyncChanges(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList entity_data) { … }
std::unique_ptr<syncer::DataBatch>
AutofillWalletOfferSyncBridge::GetDataForCommit(StorageKeyList storage_keys) { … }
std::unique_ptr<syncer::DataBatch>
AutofillWalletOfferSyncBridge::GetAllDataForDebugging() { … }
std::string AutofillWalletOfferSyncBridge::GetClientTag(
const syncer::EntityData& entity_data) { … }
std::string AutofillWalletOfferSyncBridge::GetStorageKey(
const syncer::EntityData& entity_data) { … }
bool AutofillWalletOfferSyncBridge::SupportsIncrementalUpdates() const { … }
void AutofillWalletOfferSyncBridge::ApplyDisableSyncChanges(
std::unique_ptr<syncer::MetadataChangeList> delete_metadata_change_list) { … }
std::unique_ptr<syncer::DataBatch>
AutofillWalletOfferSyncBridge::GetAllDataImpl() { … }
void AutofillWalletOfferSyncBridge::MergeRemoteData(
const syncer::EntityChangeList& entity_data) { … }
PaymentsAutofillTable* AutofillWalletOfferSyncBridge::GetAutofillTable() { … }
AutofillSyncMetadataTable*
AutofillWalletOfferSyncBridge::GetSyncMetadataStore() { … }
void AutofillWalletOfferSyncBridge::LoadAutofillOfferMetadata() { … }
}