Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: components/autofill/browser/personal_data_manager.cc

Issue 14564003: Make PersonalDataManager use GetCreditCards() (rather than using credit_cards_ directly) so Autofill (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/browser/personal_data_manager.cc
diff --git a/components/autofill/browser/personal_data_manager.cc b/components/autofill/browser/personal_data_manager.cc
index eab0ae2179a09f7692be02fe41839fedcced252f..8eeda37312c9840d54d597f635c39e53e2b57145 100644
--- a/components/autofill/browser/personal_data_manager.cc
+++ b/components/autofill/browser/personal_data_manager.cc
@@ -507,8 +507,9 @@ void PersonalDataManager::RemoveByGUID(const std::string& guid) {
}
CreditCard* PersonalDataManager::GetCreditCardByGUID(const std::string& guid) {
- for (std::vector<CreditCard*>::iterator iter = credit_cards_.begin();
- iter != credit_cards_.end(); ++iter) {
+ const std::vector<CreditCard*>& credit_cards = GetCreditCards();
+ for (std::vector<CreditCard*>::const_iterator iter = credit_cards.begin();
+ iter != credit_cards.end(); ++iter) {
if ((*iter)->guid() == guid)
return *iter;
}
@@ -554,7 +555,7 @@ const std::vector<AutofillProfile*>& PersonalDataManager::web_profiles() const {
return web_profiles_.get();
}
-const std::vector<CreditCard*>& PersonalDataManager::credit_cards() const {
+const std::vector<CreditCard*>& PersonalDataManager::GetCreditCards() const {
return credit_cards_.get();
}
@@ -656,8 +657,9 @@ void PersonalDataManager::GetCreditCardSuggestions(
icons->clear();
guid_pairs->clear();
- for (std::vector<CreditCard*>::const_iterator iter = credit_cards().begin();
- iter != credit_cards().end(); ++iter) {
+ const std::vector<CreditCard*>& credit_cards = GetCreditCards();
+ for (std::vector<CreditCard*>::const_iterator iter = credit_cards.begin();
+ iter != credit_cards.end(); ++iter) {
CreditCard* credit_card = *iter;
// The value of the stored data for this field type in the |credit_card|.
« no previous file with comments | « components/autofill/browser/personal_data_manager.h ('k') | components/autofill/browser/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698