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

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

Issue 2711543002: Experiment to add bank name in autofill ui. (Closed)
Patch Set: Don't show bank name if bank name is empty even though feature flag on Created 3 years, 10 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
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 9bd3ed769fa174af016bed0f2efadb72671ed882..a8ccdae689ea7831267b6822679c9f5435b92d08 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -511,6 +511,14 @@ base::string16 CreditCard::TypeAndLastFourDigits() const {
return type + base::string16(kMidlineEllipsis) + digits;
}
+base::string16 CreditCard::BankNameAndLastFourDigits() const {
+ base::string16 digits = LastFourDigits();
+ if (digits.empty())
+ return bank_name_;
+
+ return bank_name_ + base::string16(kMidlineEllipsis) + digits;
+}
+
base::string16 CreditCard::AbbreviatedExpirationDateForDisplay() const {
base::string16 month = ExpirationMonthAsString();
base::string16 year = Expiration2DigitYearAsString();

Powered by Google App Engine
This is Rietveld 408576698