Chromium Code Reviews| 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 34f00efc9ef1c94af0a94d9fbf6405af09c76b93..d1f8b7de5c64fc4f94ddc657358aaf3a37a5c386 100644 |
| --- a/components/autofill/browser/personal_data_manager.cc |
| +++ b/components/autofill/browser/personal_data_manager.cc |
| @@ -494,8 +494,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; |
| } |
| @@ -541,7 +542,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(); |
| } |
| @@ -643,8 +644,8 @@ void PersonalDataManager::GetCreditCardSuggestions( |
| icons->clear(); |
| guid_pairs->clear(); |
| - for (std::vector<CreditCard*>::const_iterator iter = credit_cards().begin(); |
| - iter != credit_cards().end(); ++iter) { |
| + for (std::vector<CreditCard*>::const_iterator iter = credit_cards_.begin(); |
|
Ilya Sherman
2013/04/30 08:20:29
Why not use GetCreditCards() for this method as we
Dan Beam
2013/05/01 03:46:44
Done.
|
| + iter != credit_cards_.end(); ++iter) { |
| CreditCard* credit_card = *iter; |
| // The value of the stored data for this field type in the |credit_card|. |