Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5999)

Unified Diff: chrome/browser/sync/profile_sync_components_factory_impl.cc

Issue 1110833002: [autofill] Sync server card and address metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698