| 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 33dc123d3b6a535525539d50f423f11d84295ca4..2e9ebad31be7456795267bf3845d6e6d91880fc5 100644
|
| --- a/components/autofill/core/browser/credit_card.cc
|
| +++ b/components/autofill/core/browser/credit_card.cc
|
| @@ -481,6 +481,14 @@ void CreditCard::SetExpirationYear(int expiration_year) {
|
| expiration_year_ = expiration_year;
|
| }
|
|
|
| +base::string16 CreditCard::BankNameAndLastFourDigits() const {
|
| + base::string16 digits = LastFourDigits();
|
| + // TODO(szhangcs): truncate bank name.
|
| + if (digits.empty())
|
| + return ASCIIToUTF16(bank_name_);
|
| + return ASCIIToUTF16(bank_name_) + base::string16(kMidlineEllipsis) + digits;
|
| +}
|
| +
|
| void CreditCard::operator=(const CreditCard& credit_card) {
|
| set_use_count(credit_card.use_count());
|
| set_use_date(credit_card.use_date());
|
| @@ -498,6 +506,7 @@ void CreditCard::operator=(const CreditCard& credit_card) {
|
| server_id_ = credit_card.server_id_;
|
| server_status_ = credit_card.server_status_;
|
| billing_address_id_ = credit_card.billing_address_id_;
|
| + bank_name_ = credit_card.bank_name_;
|
|
|
| set_guid(credit_card.guid());
|
| set_origin(credit_card.origin());
|
| @@ -564,6 +573,10 @@ int CreditCard::Compare(const CreditCard& credit_card) const {
|
| if (comparison != 0)
|
| return comparison;
|
|
|
| + comparison = bank_name_.compare(credit_card.bank_name_);
|
| + if (comparison != 0)
|
| + return comparison;
|
| +
|
| if (static_cast<int>(server_status_) <
|
| static_cast<int>(credit_card.server_status_))
|
| return -1;
|
|
|