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 4981866007f508448b05ef8e40c4252dbfc9523e..8784de092e86adcd623ee8aa55d6758c0960416a 100644 |
--- a/components/autofill/core/browser/personal_data_manager.cc |
+++ b/components/autofill/core/browser/personal_data_manager.cc |
@@ -447,7 +447,7 @@ bool PersonalDataManager::ImportFormData( |
// Don't import if we already have this info. |
// Don't present an infobar if we have already saved this card number. |
bool merged_credit_card = false; |
- if (local_imported_credit_card.get()) { |
+ if (local_imported_credit_card) { |
for (CreditCard* card : local_credit_cards_) { |
// Make a local copy so that the data in |local_credit_cards_| isn't |
// modified directly by the UpdateFromImportedCard() call. |
@@ -462,6 +462,19 @@ bool PersonalDataManager::ImportFormData( |
} |
} |
+ // Also don't offer to save if we already have this stored as a full wallet |
+ // card. (In particular this comes up just after filling and submitting a |
+ // Wallet card.) |
+ if (local_imported_credit_card) { |
+ for (CreditCard* card : server_credit_cards_) { |
+ if (card->record_type() == CreditCard::FULL_SERVER_CARD && |
+ local_imported_credit_card->IsLocalDuplicateOfServerCard(*card)) { |
+ local_imported_credit_card.reset(); |
+ break; |
+ } |
+ } |
+ } |
+ |
if (imported_profile.get()) { |
// We always save imported profiles. |
SaveImportedProfile(*imported_profile); |