| 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 9ea2ee76e9d734426fa39421f6d738f519dc163d..2d3129cdeaeb628f83a7336abd2b5168db37de04 100644
|
| --- a/components/autofill/core/browser/credit_card.cc
|
| +++ b/components/autofill/core/browser/credit_card.cc
|
| @@ -606,11 +606,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 {
|
|
|