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

Unified Diff: components/autofill/core/browser/personal_data_manager.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/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 5cc15a1e39b08da8f69f475dd1f26b853a631697..27b7f3365975523b9b4745b9f1fce7d6c7ad30f0 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1606,7 +1606,12 @@ std::vector<Suggestion> PersonalDataManager::GetSuggestionsForCards(
// Otherwise the label is the card number, or if that is empty the
// cardholder name. The label should never repeat the value.
if (type.GetStorableType() == CREDIT_CARD_NUMBER) {
- suggestion->value = credit_card->TypeAndLastFourDigits();
+ if (IsAutofillCreditCardBankNameDisplayExperimentEnabled()
+ && !credit_card->bank_name().empty()) {
+ suggestion->value = credit_card->BankNameAndLastFourDigits();
+ } else {
+ suggestion->value = credit_card->TypeAndLastFourDigits();
+ }
if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) {
suggestion->label =
credit_card->GetLastUsedDateForDisplay(app_locale_);

Powered by Google App Engine
This is Rietveld 408576698