Chromium Code Reviews| 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..37e0a6d5543d5ef5506789c4456f5774f7725822 100644 |
| --- a/components/autofill/core/browser/personal_data_manager.cc |
| +++ b/components/autofill/core/browser/personal_data_manager.cc |
| @@ -1197,21 +1197,26 @@ void PersonalDataManager::EnabledPrefChanged() { |
| const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles( |
| bool record_metrics) const { |
| #if defined(OS_MACOSX) && !defined(OS_IOS) |
| - if (!pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook)) |
| - return web_profiles(); |
| + bool use_auxiliary_profiles = |
| + pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook); |
| #else |
| - if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)) |
| - return web_profiles(); |
| + bool use_auxiliary_profiles = |
| + pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled); |
| #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| profiles_.clear(); |
| // Populates |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) |
| + LoadAuxiliaryProfiles(record_metrics); |
| + |
| + const std::vector<AutofillProfile*>& web_profiles = this->web_profiles(); |
| + profiles_.insert(profiles_.end(), web_profiles.begin(), web_profiles.end()); |
|
Evan Stade
2015/02/05 04:07:25
why can't you just use web_profiles() inline?
Walter Cacau
2015/02/05 04:12:03
inlined now
I initially thought that web_profiles
|
| + 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_; |