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

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

Issue 2674573010: [Autofill] Transfer billing address of server cards when deduping. (Closed)
Patch Set: Created 3 years, 10 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/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 88096ec268add4bf40bbdcdcd09c9135b5dddcf2..dad0d3890f6d7ace1e82c42b2eaf4faf6ff815c1 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1820,7 +1820,7 @@ void PersonalDataManager::UpdateCardsBillingAddressReference(
C -> D
*/
- for (auto& credit_card : local_credit_cards_) {
+ for (auto& credit_card : GetCreditCards()) {
// If the credit card is not associated with a billing address, skip it.
if (credit_card->billing_address_id().empty())
break;
@@ -1847,7 +1847,10 @@ void PersonalDataManager::UpdateCardsBillingAddressReference(
// If the card was modified, apply the changes to the database.
if (was_modified) {
- database_->UpdateCreditCard(*credit_card);
+ if (credit_card->record_type() == CreditCard::LOCAL_CARD)
+ database_->UpdateCreditCard(*credit_card);
+ else
+ database_->UpdateServerCardMetadata(*credit_card);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698