diff options
author | nednguyen <nednguyen@google.com> | 2015-11-13 14:18:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-13 22:19:18 +0000 |
commit | b70233fbb79edf633ca9826c35923f6612d7b476 (patch) | |
tree | ae82df81e053efbdd6fb95baa31847820e59aeae | |
parent | abf012019becca08c697f61430f61c6292ead226 (diff) | |
download | chromium_src-b70233fbb79edf633ca9826c35923f6612d7b476.zip chromium_src-b70233fbb79edf633ca9826c35923f6612d7b476.tar.gz chromium_src-b70233fbb79edf633ca9826c35923f6612d7b476.tar.bz2 |
Revert of Reland: Enable Wallet metadata sync. (patchset #1 id:1 of https://codereview.chromium.org/1396883005/ )
Reason for revert:
Speculative revert to see if this patch regresses blink_perf.shadow_dom benchmark
BUG=543496
Original issue's description:
> Reland: Enable Wallet metadata sync.
>
> Originally landed in https://crrev.com/90c4e947, which enabled a code
> path where https://crrev.com/6aeb9079 introduced a bug a few hours
> earlier. The bug was detected in tests, which resulted in a revert.
> https://crrev.com/7a8e3fdf fixed the bug in the hidden code path. It's
> safe to reland now.
>
> TBR=zea@chromium.org, estade@chromium.org
> BUG=481595
>
> Committed: https://crrev.com/0b999094d4ce8a462b70327cc38ca117313a1504
> Cr-Commit-Position: refs/heads/master@{#353927}
TBR=estade@chromium.org,zea@chromium.org,rouslan@chromium.org
BUG=481595
Review URL: https://codereview.chromium.org/1444743002
Cr-Commit-Position: refs/heads/master@{#359666}
5 files changed, 17 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 5a3d501..a482550 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc @@ -109,7 +109,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 @@ -187,10 +191,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( ui_thread, db_thread, error_callback, sync_client, 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 e613633..a2f2f1f 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc @@ -54,7 +54,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 69619dd..0cfc95f 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. diff --git a/components/autofill/core/common/autofill_switches.cc b/components/autofill/core/common/autofill_switches.cc index 63edd24..cefd0ec 100644 --- a/components/autofill/core/common/autofill_switches.cc +++ b/components/autofill/core/common/autofill_switches.cc @@ -71,6 +71,10 @@ 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 1c34827..8be409a 100644 --- a/components/autofill/core/common/autofill_switches.h +++ b/components/autofill/core/common/autofill_switches.h @@ -28,6 +28,7 @@ extern const char kEnableOfferUploadCreditCards[]; 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[]; |