Chromium Code Reviews| 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 d2a931c0d2b3453dd07752fa471eedb3d55e245c..735ae249d039543b18a056c174eb516a0b1669b1 100644 |
| --- a/components/autofill/core/browser/personal_data_manager.cc |
| +++ b/components/autofill/core/browser/personal_data_manager.cc |
| @@ -1633,8 +1633,25 @@ 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() && |
| + !IsKeyboardAccessoryEnabled()) { |
| + if (ShowExpirationDateInAutofillCreditCardLastUsedDate()) { |
| + suggestion->label = credit_card->GetInfo( |
| + AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); |
| + } |
| + if (suggestion->label.empty()) { |
| + suggestion->label = credit_card->GetLastUsedDateForDisplay( |
| + ShowExpirationDateInAutofillCreditCardLastUsedDate(), |
| + ShowTimeDetailInAutofillCreditCardLastUsedDate()); |
| + } else { |
| + suggestion->label.append(credit_card->GetLastUsedDateForDisplay( |
| + ShowExpirationDateInAutofillCreditCardLastUsedDate(), |
| + ShowTimeDetailInAutofillCreditCardLastUsedDate())); |
|
jungshik at Google
2017/01/23 21:43:24
This kind of concatenating strings (Exp. date + La
jiahuiguo
2017/01/26 05:46:13
Done.
|
| + } |
| + } 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()) { |