summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrouslan <rouslan@chromium.org>2015-10-06 14:11:30 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-06 21:12:30 +0000
commit90c4e9472b95803cf8220cd749a25523aa80b0b3 (patch)
tree5304c5f3364adbc5412ba7683ba8ff9ca4f1f31b
parent1cd5fee938b55399ff68538699e453c110021d8c (diff)
downloadchromium_src-90c4e9472b95803cf8220cd749a25523aa80b0b3.zip
chromium_src-90c4e9472b95803cf8220cd749a25523aa80b0b3.tar.gz
chromium_src-90c4e9472b95803cf8220cd749a25523aa80b0b3.tar.bz2
Enable Wallet metadata sync.
BUG=481595 Review URL: https://codereview.chromium.org/1387193003 Cr-Commit-Position: refs/heads/master@{#352686}
-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
-rw-r--r--components/autofill/core/common/autofill_switches.cc4
-rw-r--r--components/autofill/core/common/autofill_switches.h1
5 files changed, 9 insertions, 17 deletions
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index 207a0a7..5b564fd 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -115,11 +115,7 @@ syncer::ModelTypeSet GetDisabledTypesFromCommandLine(
syncer::ModelTypeSet GetEnabledTypesFromCommandLine(
const base::CommandLine& command_line) {
- syncer::ModelTypeSet enabled_types;
- if (command_line.HasSwitch(autofill::switches::kEnableWalletMetadataSync))
- enabled_types.Put(syncer::AUTOFILL_WALLET_METADATA);
-
- return enabled_types;
+ return syncer::ModelTypeSet();
}
} // namespace
@@ -193,10 +189,10 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes(
syncer::AUTOFILL_WALLET_DATA));
}
- // 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)) {
+ // 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)) {
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 1525972..df46117 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
@@ -52,6 +52,7 @@ 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 3a49d89..9acd993 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_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
+ ASSERT_TRUE(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_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
+ ASSERT_TRUE(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_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
+ ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
syncer::AUTOFILL_WALLET_METADATA));
// Then disable the experiment.
diff --git a/components/autofill/core/common/autofill_switches.cc b/components/autofill/core/common/autofill_switches.cc
index 0bd07e0..79e8db4 100644
--- a/components/autofill/core/common/autofill_switches.cc
+++ b/components/autofill/core/common/autofill_switches.cc
@@ -64,10 +64,6 @@ const char kEnableSingleClickAutofill[] = "enable-single-click-autofill";
const char kEnableSuggestionsWithSubstringMatch[] =
"enable-suggestions-with-substring-match";
-// Enables syncing usage counts and last use dates of Wallet addresses and
-// cards.
-const char kEnableWalletMetadataSync[] = "enable-wallet-metadata-sync";
-
// Ignores autocomplete="off" for Autofill data (profiles + credit cards).
const char kIgnoreAutocompleteOffForAutofill[] =
"ignore-autocomplete-off-autofill";
diff --git a/components/autofill/core/common/autofill_switches.h b/components/autofill/core/common/autofill_switches.h
index fb48e39..b4e7a35 100644
--- a/components/autofill/core/common/autofill_switches.h
+++ b/components/autofill/core/common/autofill_switches.h
@@ -26,7 +26,6 @@ extern const char kEnableOfferStoreUnmaskedWalletCards[];
extern const char kEnablePasswordGeneration[];
extern const char kEnableSingleClickAutofill[];
extern const char kEnableSuggestionsWithSubstringMatch[];
-extern const char kEnableWalletMetadataSync[];
extern const char kIgnoreAutocompleteOffForAutofill[];
extern const char kLocalHeuristicsOnlyForPasswordGeneration[];
extern const char kShowAutofillTypePredictions[];