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

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

Issue 2711543002: Experiment to add bank name in autofill ui. (Closed)
Patch Set: add more unit test 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..2554abfcc80da31e2b63f644d6a2035b451757a8 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -501,14 +501,19 @@ base::string16 CreditCard::TypeForDisplay() const {
}
base::string16 CreditCard::TypeAndLastFourDigits() const {
- base::string16 type = TypeForDisplay();
+ base::string16 card_type;
+ if (IsAutofillCreditCardBankNameDisplayExperimentEnabled()) {
+ card_type = bank_name();
+ } else {
+ card_type = TypeForDisplay();
+ }
base::string16 digits = LastFourDigits();
if (digits.empty())
- return type;
+ return card_type;
// TODO(estade): i18n?
- return type + base::string16(kMidlineEllipsis) + digits;
+ return card_type + base::string16(kMidlineEllipsis) + digits;
}
base::string16 CreditCard::AbbreviatedExpirationDateForDisplay() const {

Powered by Google App Engine
This is Rietveld 408576698