Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/autofill/core/browser/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 | 10 |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 void PersonalDataManager::EnabledPrefChanged() { | 1192 void PersonalDataManager::EnabledPrefChanged() { |
| 1193 default_country_code_.clear(); | 1193 default_country_code_.clear(); |
| 1194 NotifyPersonalDataChanged(); | 1194 NotifyPersonalDataChanged(); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles( | 1197 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles( |
| 1198 bool record_metrics) const { | 1198 bool record_metrics) const { |
| 1199 #if defined(OS_MACOSX) && !defined(OS_IOS) | 1199 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1200 if (!pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook)) | 1200 bool use_auxiliary_profiles = |
| 1201 return web_profiles(); | 1201 pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook); |
| 1202 #else | 1202 #else |
| 1203 if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)) | 1203 bool use_auxiliary_profiles = |
| 1204 return web_profiles(); | 1204 pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled); |
| 1205 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 1205 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 1206 | 1206 |
| 1207 profiles_.clear(); | 1207 profiles_.clear(); |
| 1208 | 1208 |
| 1209 // Populates |auxiliary_profiles_|. | 1209 // Populates |auxiliary_profiles_|. |
| 1210 LoadAuxiliaryProfiles(record_metrics); | 1210 if (use_auxiliary_profiles) |
| 1211 LoadAuxiliaryProfiles(record_metrics); | |
| 1211 | 1212 |
| 1212 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); | 1213 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); |
|
Evan Stade
2015/02/03 20:02:11
couldn't you fix this by changing these web_profil
Walter Cacau
2015/02/03 20:25:00
Unfortunately this does not work because test_pers
Walter Cacau
2015/02/05 04:00:18
I was wrong. There is no conflict in the profiles_
| |
| 1213 profiles_.insert( | 1214 if (use_auxiliary_profiles) { |
| 1214 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end()); | 1215 profiles_.insert( |
| 1216 profiles_.end(), auxiliary_profiles_.begin(), | |
| 1217 auxiliary_profiles_.end()); | |
| 1218 } | |
| 1215 profiles_.insert( | 1219 profiles_.insert( |
| 1216 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); | 1220 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); |
| 1217 return profiles_; | 1221 return profiles_; |
| 1218 } | 1222 } |
| 1219 | 1223 |
| 1220 } // namespace autofill | 1224 } // namespace autofill |
| OLD | NEW |