| 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..fbb4ba59d1392aa05b06d374d7f39d03b2145e54 100644
|
| --- a/components/autofill/core/browser/personal_data_manager.cc
|
| +++ b/components/autofill/core/browser/personal_data_manager.cc
|
| @@ -226,6 +226,7 @@ PersonalDataManager::PersonalDataManager(const std::string& app_locale)
|
| pending_server_profiles_query_(0),
|
| pending_creditcards_query_(0),
|
| pending_server_creditcards_query_(0),
|
| + test_force_wallet_card_sync_enabled_(false),
|
| app_locale_(app_locale),
|
| pref_service_(NULL),
|
| is_off_the_record_(false),
|
| @@ -675,9 +676,10 @@ 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) &&
|
| - pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) {
|
| + if (test_force_wallet_card_sync_enabled_ ||
|
| + (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableWalletCardImport) &&
|
| + pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled))) {
|
| credit_cards_.insert(credit_cards_.end(), server_credit_cards_.begin(),
|
| server_credit_cards_.end());
|
| }
|
| @@ -1196,22 +1198,26 @@ void PersonalDataManager::EnabledPrefChanged() {
|
|
|
| const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles(
|
| bool record_metrics) const {
|
| + bool use_auxiliary_profiles =
|
| #if defined(OS_MACOSX) && !defined(OS_IOS)
|
| - if (!pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook))
|
| - return web_profiles();
|
| + pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook);
|
| #else
|
| - if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled))
|
| - return web_profiles();
|
| + pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled);
|
| #endif // defined(OS_MACOSX) && !defined(OS_IOS)
|
|
|
| profiles_.clear();
|
|
|
| // Populates |auxiliary_profiles_|.
|
| - LoadAuxiliaryProfiles(record_metrics);
|
| + if (use_auxiliary_profiles) {
|
| + LoadAuxiliaryProfiles(record_metrics);
|
| + }
|
|
|
| profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end());
|
| - profiles_.insert(
|
| - profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end());
|
| + if (use_auxiliary_profiles) {
|
| + profiles_.insert(
|
| + profiles_.end(), auxiliary_profiles_.begin(),
|
| + auxiliary_profiles_.end());
|
| + }
|
| profiles_.insert(
|
| profiles_.end(), server_profiles_.begin(), server_profiles_.end());
|
| return profiles_;
|
|
|