| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/personal_data_manager.h" | 5 #include "components/autofill/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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 iter != credit_cards_.end(); ++iter) { | 532 iter != credit_cards_.end(); ++iter) { |
| 533 (*iter)->GetNonEmptyTypes(app_locale_, non_empty_types); | 533 (*iter)->GetNonEmptyTypes(app_locale_, non_empty_types); |
| 534 } | 534 } |
| 535 } | 535 } |
| 536 | 536 |
| 537 bool PersonalDataManager::IsDataLoaded() const { | 537 bool PersonalDataManager::IsDataLoaded() const { |
| 538 return is_data_loaded_; | 538 return is_data_loaded_; |
| 539 } | 539 } |
| 540 | 540 |
| 541 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles() { | 541 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles() { |
| 542 if (!components::UserPrefs::Get(browser_context_)->GetBoolean( | 542 if (!user_prefs::UserPrefs::Get(browser_context_)->GetBoolean( |
| 543 prefs::kAutofillAuxiliaryProfilesEnabled)) { | 543 prefs::kAutofillAuxiliaryProfilesEnabled)) { |
| 544 return web_profiles(); | 544 return web_profiles(); |
| 545 } | 545 } |
| 546 | 546 |
| 547 profiles_.clear(); | 547 profiles_.clear(); |
| 548 | 548 |
| 549 // Populates |auxiliary_profiles_|. | 549 // Populates |auxiliary_profiles_|. |
| 550 LoadAuxiliaryProfiles(); | 550 LoadAuxiliaryProfiles(); |
| 551 | 551 |
| 552 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); | 552 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 | 685 |
| 686 values->push_back(creditcard_field_value); | 686 values->push_back(creditcard_field_value); |
| 687 labels->push_back(label); | 687 labels->push_back(label); |
| 688 icons->push_back(UTF8ToUTF16(credit_card->type())); | 688 icons->push_back(UTF8ToUTF16(credit_card->type())); |
| 689 guid_pairs->push_back(GUIDPair(credit_card->guid(), 0)); | 689 guid_pairs->push_back(GUIDPair(credit_card->guid(), 0)); |
| 690 } | 690 } |
| 691 } | 691 } |
| 692 } | 692 } |
| 693 | 693 |
| 694 bool PersonalDataManager::IsAutofillEnabled() const { | 694 bool PersonalDataManager::IsAutofillEnabled() const { |
| 695 return components::UserPrefs::Get(browser_context_)->GetBoolean( | 695 return user_prefs::UserPrefs::Get(browser_context_)->GetBoolean( |
| 696 prefs::kAutofillEnabled); | 696 prefs::kAutofillEnabled); |
| 697 } | 697 } |
| 698 | 698 |
| 699 // static | 699 // static |
| 700 bool PersonalDataManager::IsValidLearnableProfile( | 700 bool PersonalDataManager::IsValidLearnableProfile( |
| 701 const AutofillProfile& profile, | 701 const AutofillProfile& profile, |
| 702 const std::string& app_locale) { | 702 const std::string& app_locale) { |
| 703 if (!IsMinimumAddress(profile, app_locale)) | 703 if (!IsMinimumAddress(profile, app_locale)) |
| 704 return false; | 704 return false; |
| 705 | 705 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 const AutofillMetrics* metric_logger) { | 1022 const AutofillMetrics* metric_logger) { |
| 1023 metric_logger_.reset(metric_logger); | 1023 metric_logger_.reset(metric_logger); |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 void PersonalDataManager::set_browser_context( | 1026 void PersonalDataManager::set_browser_context( |
| 1027 content::BrowserContext* context) { | 1027 content::BrowserContext* context) { |
| 1028 browser_context_ = context; | 1028 browser_context_ = context; |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 } // namespace autofill | 1031 } // namespace autofill |
| OLD | NEW |