| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 iter != credit_cards_.end(); ++iter) { | 518 iter != credit_cards_.end(); ++iter) { |
| 519 (*iter)->GetNonEmptyTypes(app_locale_, non_empty_types); | 519 (*iter)->GetNonEmptyTypes(app_locale_, non_empty_types); |
| 520 } | 520 } |
| 521 } | 521 } |
| 522 | 522 |
| 523 bool PersonalDataManager::IsDataLoaded() const { | 523 bool PersonalDataManager::IsDataLoaded() const { |
| 524 return is_data_loaded_; | 524 return is_data_loaded_; |
| 525 } | 525 } |
| 526 | 526 |
| 527 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles() const { | 527 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles() const { |
| 528 if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)) { | 528 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 529 if (!pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook)) |
| 529 return web_profiles(); | 530 return web_profiles(); |
| 530 } | 531 #else |
| 532 if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)) |
| 533 return web_profiles(); |
| 534 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 531 | 535 |
| 532 profiles_.clear(); | 536 profiles_.clear(); |
| 533 | 537 |
| 534 // Populates |auxiliary_profiles_|. | 538 // Populates |auxiliary_profiles_|. |
| 535 LoadAuxiliaryProfiles(); | 539 LoadAuxiliaryProfiles(); |
| 536 | 540 |
| 537 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); | 541 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); |
| 538 profiles_.insert(profiles_.end(), | 542 profiles_.insert(profiles_.end(), |
| 539 auxiliary_profiles_.begin(), auxiliary_profiles_.end()); | 543 auxiliary_profiles_.begin(), auxiliary_profiles_.end()); |
| 540 return profiles_; | 544 return profiles_; |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 | 1076 |
| 1073 return std::string(); | 1077 return std::string(); |
| 1074 } | 1078 } |
| 1075 | 1079 |
| 1076 void PersonalDataManager::EnabledPrefChanged() { | 1080 void PersonalDataManager::EnabledPrefChanged() { |
| 1077 default_country_code_.clear(); | 1081 default_country_code_.clear(); |
| 1078 NotifyPersonalDataChanged(); | 1082 NotifyPersonalDataChanged(); |
| 1079 } | 1083 } |
| 1080 | 1084 |
| 1081 } // namespace autofill | 1085 } // namespace autofill |
| OLD | NEW |