| 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 dd5baecd6b0ae209de2b5ef6dd44e767fa83e463..092ce78302fe3390155e1961d0e47251aa40ec88 100644
|
| --- a/components/autofill/core/browser/personal_data_manager.cc
|
| +++ b/components/autofill/core/browser/personal_data_manager.cc
|
| @@ -652,7 +652,8 @@ void PersonalDataManager::GetCreditCardSuggestions(
|
| std::vector<base::string16>* values,
|
| std::vector<base::string16>* labels,
|
| std::vector<base::string16>* icons,
|
| - std::vector<GUIDPair>* guid_pairs) {
|
| + std::vector<GUIDPair>* guid_pairs,
|
| + bool obfuscate_number) {
|
| values->clear();
|
| labels->clear();
|
| icons->clear();
|
| @@ -666,16 +667,20 @@ void PersonalDataManager::GetCreditCardSuggestions(
|
| // The value of the stored data for this field type in the |credit_card|.
|
| base::string16 creditcard_field_value =
|
| credit_card->GetInfo(type, app_locale_);
|
| - if (!creditcard_field_value.empty() &&
|
| - StartsWith(creditcard_field_value, field_contents, false)) {
|
| - if (type.GetStorableType() == CREDIT_CARD_NUMBER)
|
| - creditcard_field_value = credit_card->ObfuscatedNumber();
|
|
|
| + if (!creditcard_field_value.empty() &&
|
| + (StartsWith(creditcard_field_value, field_contents, false) ||
|
| + (type.GetStorableType() == CREDIT_CARD_NUMBER &&
|
| + base::string16::npos !=
|
| + creditcard_field_value.find(field_contents)))) {
|
| // If the value is the card number, the label is the expiration date.
|
| // Otherwise the label is the card number, or if that is empty the
|
| // cardholder name. The label should never repeat the value.
|
| base::string16 label;
|
| if (type.GetStorableType() == CREDIT_CARD_NUMBER) {
|
| + if (obfuscate_number)
|
| + creditcard_field_value = credit_card->ObfuscatedNumber();
|
| +
|
| label = credit_card->GetInfo(
|
| AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
|
| } else if (credit_card->number().empty()) {
|
|
|