summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/profile_sync_components_factory_impl.cc14
-rw-r--r--chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc1
-rw-r--r--chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc6
3 files changed, 12 insertions, 9 deletions
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index 5b564fd..207a0a7 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -115,7 +115,11 @@ syncer::ModelTypeSet GetDisabledTypesFromCommandLine(
syncer::ModelTypeSet GetEnabledTypesFromCommandLine(
const base::CommandLine& command_line) {
- return syncer::ModelTypeSet();
+ syncer::ModelTypeSet enabled_types;
+ if (command_line.HasSwitch(autofill::switches::kEnableWalletMetadataSync))
+ enabled_types.Put(syncer::AUTOFILL_WALLET_METADATA);
+
+ return enabled_types;
}
} // namespace
@@ -189,10 +193,10 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes(
syncer::AUTOFILL_WALLET_DATA));
}
- // Wallet metadata sync depends on Wallet data sync. Register if Wallet data
- // is syncing and metadata sync is not explicitly disabled.
- if (!wallet_disabled &&
- !disabled_types.Has(syncer::AUTOFILL_WALLET_METADATA)) {
+ // Wallet metadata sync depends on Wallet data sync and is disabled by
+ // default. Register if Wallet data is syncing and metadata sync is explicitly
+ // enabled.
+ if (!wallet_disabled && enabled_types.Has(syncer::AUTOFILL_WALLET_METADATA)) {
sync_service->RegisterDataTypeController(
new browser_sync::AutofillWalletDataTypeController(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
index df46117..1525972 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
@@ -52,7 +52,6 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test {
datatypes.push_back(syncer::AUTOFILL);
datatypes.push_back(syncer::AUTOFILL_PROFILE);
datatypes.push_back(syncer::AUTOFILL_WALLET_DATA);
- datatypes.push_back(syncer::AUTOFILL_WALLET_METADATA);
datatypes.push_back(syncer::BOOKMARKS);
datatypes.push_back(syncer::DEVICE_INFO);
#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS)
diff --git a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
index 9acd993..3a49d89 100644
--- a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
@@ -137,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, EnabledViaPreference) {
syncer::AUTOFILL_WALLET_DATA));
// TODO(pvalenzuela): Assert that the local root node for AUTOFILL_WALLET_DATA
// exists.
- ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
+ ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
syncer::AUTOFILL_WALLET_METADATA));
}
@@ -157,7 +157,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest,
ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
syncer::AUTOFILL_WALLET_DATA));
- ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
+ ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
syncer::AUTOFILL_WALLET_METADATA));
}
@@ -185,7 +185,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest,
ASSERT_FALSE(enabled_checker.TimedOut());
ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
syncer::AUTOFILL_WALLET_DATA));
- ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
+ ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
syncer::AUTOFILL_WALLET_METADATA));
// Then disable the experiment.