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

Unified Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 875243003: Add sync experiment flag for wallet datatype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 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: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 911d07b047e83d2ac6d69f1d03bf8669db355f20..fcc36877c7b07d9bad0ea6f0bd9334b81e52ef34 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -675,8 +675,7 @@ const std::vector<CreditCard*>& PersonalDataManager::GetCreditCards() const {
credit_cards_.clear();
credit_cards_.insert(credit_cards_.end(), local_credit_cards_.begin(),
local_credit_cards_.end());
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableWalletCardImport) &&
+ if (IsExperimentalWalletIntegrationEnabled() &&
pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) {
credit_cards_.insert(credit_cards_.end(), server_credit_cards_.begin(),
server_credit_cards_.end());
@@ -960,6 +959,13 @@ const std::string& PersonalDataManager::GetDefaultCountryCodeForNewAddress()
return default_country_code_;
}
+bool PersonalDataManager::IsExperimentalWalletIntegrationEnabled() const {
+ // The feature can be enabled by sync experiment *or* command line flag.
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWalletCardImport) ||
+ pref_service_->GetBoolean(prefs::kAutofillWalletSyncExperimentEnabled);
+}
+
void PersonalDataManager::SetProfiles(std::vector<AutofillProfile>* profiles) {
if (is_off_the_record_)
return;
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.h ('k') | components/autofill/core/common/autofill_pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698