| Index: chrome/browser/sync/profile_sync_components_factory_impl.cc
|
| diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
|
| index 1d02228a304a9b3c6fd31420942d92054ef9c047..064351a7d0fd9e0a1a1b7d4a1a9edd6b4acaf4a6 100644
|
| --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
|
| +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
|
| @@ -45,6 +45,7 @@
|
| #include "chrome/common/pref_names.h"
|
| #include "components/autofill/core/browser/webdata/autocomplete_syncable_service.h"
|
| #include "components/autofill/core/browser/webdata/autofill_profile_syncable_service.h"
|
| +#include "components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.h"
|
| #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_service.h"
|
| #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
|
| #include "components/autofill/core/common/autofill_pref_names.h"
|
| @@ -229,11 +230,23 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes(
|
| new AutofillProfileDataTypeController(this, profile_));
|
| }
|
|
|
| - // Autofill wallet sync is enabled by default, but behind a syncer experiment
|
| + // Wallet data sync is enabled by default, but behind a syncer experiment
|
| // enforced by the datatype controller. Register unless explicitly disabled.
|
| - if (!disabled_types.Has(syncer::AUTOFILL_WALLET_DATA)) {
|
| + bool wallet_disabled = disabled_types.Has(syncer::AUTOFILL_WALLET_DATA);
|
| + if (!wallet_disabled) {
|
| pss->RegisterDataTypeController(
|
| - new browser_sync::AutofillWalletDataTypeController(this, profile_));
|
| + new browser_sync::AutofillWalletDataTypeController(
|
| + this, profile_, syncer::AUTOFILL_WALLET_DATA));
|
| + }
|
| +
|
| + // Wallet metadata sync is enabled by default. Same as wallet data, the
|
| + // metadata sync is behind an experiment enforced by the controller. Register
|
| + // if wallet data is syncing and metadata sync is not explicitly disabled.
|
| + if (!disabled_types.Has(syncer::AUTOFILL_WALLET_METADATA) &&
|
| + !wallet_disabled) {
|
| + pss->RegisterDataTypeController(
|
| + new browser_sync::AutofillWalletDataTypeController(
|
| + this, profile_, syncer::AUTOFILL_WALLET_METADATA));
|
| }
|
|
|
| // Bookmark sync is enabled by default. Register unless explicitly
|
| @@ -494,7 +507,8 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl::
|
| syncer::PRIORITY_PREFERENCES)->AsWeakPtr();
|
| case syncer::AUTOFILL:
|
| case syncer::AUTOFILL_PROFILE:
|
| - case syncer::AUTOFILL_WALLET_DATA: {
|
| + case syncer::AUTOFILL_WALLET_DATA:
|
| + case syncer::AUTOFILL_WALLET_METADATA: {
|
| if (!web_data_service_.get())
|
| return base::WeakPtr<syncer::SyncableService>();
|
| if (type == syncer::AUTOFILL) {
|
| @@ -503,6 +517,9 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl::
|
| } else if (type == syncer::AUTOFILL_PROFILE) {
|
| return autofill::AutofillProfileSyncableService::FromWebDataService(
|
| web_data_service_.get())->AsWeakPtr();
|
| + } else if (type == syncer::AUTOFILL_WALLET_METADATA) {
|
| + return autofill::AutofillWalletMetadataSyncableService::
|
| + FromWebDataService(web_data_service_.get())->AsWeakPtr();
|
| }
|
| return autofill::AutofillWalletSyncableService::FromWebDataService(
|
| web_data_service_.get())->AsWeakPtr();
|
|
|