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

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

Issue 2607043002: [Autofill] Credit Card Autofill Last Used Date Experiment (Closed)
Patch Set: Addressed comments 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 eff7020b054fea553892be1ff98c612a15fca13a..5cc15a1e39b08da8f69f475dd1f26b853a631697 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1607,8 +1607,13 @@ std::vector<Suggestion> PersonalDataManager::GetSuggestionsForCards(
// cardholder name. The label should never repeat the value.
if (type.GetStorableType() == CREDIT_CARD_NUMBER) {
suggestion->value = credit_card->TypeAndLastFourDigits();
- suggestion->label = credit_card->GetInfo(
- AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
+ if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) {
+ suggestion->label =
+ credit_card->GetLastUsedDateForDisplay(app_locale_);
+ } else {
+ suggestion->label = credit_card->GetInfo(
+ AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
+ }
if (IsAutofillCreditCardPopupLayoutExperimentEnabled())
ModifyAutofillCreditCardSuggestion(suggestion);
} else if (credit_card->number().empty()) {

Powered by Google App Engine
This is Rietveld 408576698