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

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

Issue 1808613004: Don't ever attempt to upload credit cards whose numbers match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « components/autofill/core/browser/credit_card_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c7ec6db6616e947e8e672a3361ff86164975a38d..73d19e1dcffd4b0b0b15cd151357b29c5b253280 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1425,8 +1425,12 @@ bool PersonalDataManager::ImportCreditCard(
}
// Also don't offer to save if we already have this stored as a server card.
+ // We only check the number because if the new card has the same number as the
+ // server card, upload is guaranteed to fail. There's no mechanism for entries
+ // with the same number but different names or expiration dates as there is
+ // for local cards.
for (const CreditCard* card : server_credit_cards_) {
- if (candidate_credit_card.IsLocalDuplicateOfServerCard(*card))
+ if (candidate_credit_card.HasSameNumberAs(*card))
return false;
}
« no previous file with comments | « components/autofill/core/browser/credit_card_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698