| Index: components/autofill/core/browser/credit_card.cc
|
| diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
|
| index 9083b4035b18829a2ae6e12c398c69b8ebce2c8b..6c92cccee5cad1b4a68a730d81beb0b0f20b833f 100644
|
| --- a/components/autofill/core/browser/credit_card.cc
|
| +++ b/components/autofill/core/browser/credit_card.cc
|
| @@ -598,11 +598,17 @@ bool CreditCard::IsLocalDuplicateOfServerCard(const CreditCard& other) const {
|
| if (number_.empty())
|
| return true;
|
|
|
| - if (other.record_type() == FULL_SERVER_CARD)
|
| - return StripSeparators(number_) == StripSeparators(other.number_);
|
| + return HasSameNumberAs(other);
|
| +}
|
|
|
| +bool CreditCard::HasSameNumberAs(const CreditCard& other) const {
|
| // For masked cards, this is the best we can do to compare card numbers.
|
| - return TypeAndLastFourDigits() == other.TypeAndLastFourDigits();
|
| + if (record_type() == MASKED_SERVER_CARD ||
|
| + other.record_type() == MASKED_SERVER_CARD) {
|
| + return TypeAndLastFourDigits() == other.TypeAndLastFourDigits();
|
| + }
|
| +
|
| + return StripSeparators(number_) == StripSeparators(other.number_);
|
| }
|
|
|
| bool CreditCard::operator==(const CreditCard& credit_card) const {
|
|
|