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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1189 return std::string(); | 1189 return std::string(); |
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 bool use_auxiliary_profiles = | |
Evan Stade
2015/02/03 01:51:36
this kind of ifdef splicing confuses a lot of synt
Walter Cacau
2015/02/03 02:15:25
Done.
| |
1199 #if defined(OS_MACOSX) && !defined(OS_IOS) | 1200 #if defined(OS_MACOSX) && !defined(OS_IOS) |
1200 if (!pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook)) | 1201 pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook); |
1201 return web_profiles(); | |
1202 #else | 1202 #else |
1203 if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)) | 1203 pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled); |
1204 return web_profiles(); | |
1205 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 1204 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
1206 | 1205 |
1207 profiles_.clear(); | 1206 profiles_.clear(); |
1208 | 1207 |
1209 // Populates |auxiliary_profiles_|. | 1208 // Populates |auxiliary_profiles_|. |
1210 LoadAuxiliaryProfiles(record_metrics); | 1209 if (use_auxiliary_profiles) { |
Evan Stade
2015/02/03 01:51:36
no curlies
Walter Cacau
2015/02/03 02:15:25
Done.
| |
1210 LoadAuxiliaryProfiles(record_metrics); | |
1211 } | |
1211 | 1212 |
1212 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); | 1213 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); |
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 |