Chromium Code Reviews| Index: components/autofill/browser/autofill_manager.cc |
| diff --git a/components/autofill/browser/autofill_manager.cc b/components/autofill/browser/autofill_manager.cc |
| index 20c16e8bf3d2f0b263dea40ab64d4e322af53c2b..d9237f078b5bb1666692e78e5353e8133436a27c 100644 |
| --- a/components/autofill/browser/autofill_manager.cc |
| +++ b/components/autofill/browser/autofill_manager.cc |
| @@ -340,8 +340,8 @@ bool AutofillManager::OnFormSubmitted(const FormData& form, |
| // Only upload server statistics and UMA metrics if at least some local data |
| // is available to use as a baseline. |
| const std::vector<AutofillProfile*>& profiles = personal_data_->GetProfiles(); |
| - const std::vector<CreditCard*>& credit_cards = personal_data_->credit_cards(); |
|
Ilya Sherman
2013/04/30 08:20:29
nit: Please preserve this variable name.
Dan Beam
2013/05/01 03:46:44
Done.
|
| - if (!profiles.empty() || !credit_cards.empty()) { |
| + const std::vector<CreditCard*>& cards = personal_data_->GetCreditCards(); |
| + if (!profiles.empty() || !cards.empty()) { |
| // Copy the profile and credit card data, so that it can be accessed on a |
| // separate thread. |
| std::vector<AutofillProfile> copied_profiles; |
| @@ -351,11 +351,11 @@ bool AutofillManager::OnFormSubmitted(const FormData& form, |
| copied_profiles.push_back(**it); |
| } |
| - std::vector<CreditCard> copied_credit_cards; |
| - copied_credit_cards.reserve(credit_cards.size()); |
| - for (std::vector<CreditCard*>::const_iterator it = credit_cards.begin(); |
| - it != credit_cards.end(); ++it) { |
| - copied_credit_cards.push_back(**it); |
| + std::vector<CreditCard> copied_cards; |
| + copied_cards.reserve(cards.size()); |
| + for (std::vector<CreditCard*>::const_iterator it = cards.begin(); |
| + it != cards.end(); ++it) { |
| + copied_cards.push_back(**it); |
| } |
| // Note that ownership of |submitted_form| is passed to the second task, |
| @@ -365,7 +365,7 @@ bool AutofillManager::OnFormSubmitted(const FormData& form, |
| FROM_HERE, |
| base::Bind(&DeterminePossibleFieldTypesForUpload, |
| copied_profiles, |
| - copied_credit_cards, |
| + copied_cards, |
| app_locale_, |
| raw_submitted_form), |
| base::Bind(&AutofillManager::UploadFormDataAsyncCallback, |
| @@ -970,7 +970,7 @@ bool AutofillManager::GetHost(RenderViewHost** host) const { |
| // No autofill data to return if the profiles are empty. |
| if (personal_data_->GetProfiles().empty() && |
| - personal_data_->credit_cards().empty()) { |
| + personal_data_->GetCreditCards().empty()) { |
| return false; |
| } |