OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 suggestion->icon = base::UTF8ToUTF16(credit_card->type()); | 1607 suggestion->icon = base::UTF8ToUTF16(credit_card->type()); |
1608 suggestion->backend_id = credit_card->guid(); | 1608 suggestion->backend_id = credit_card->guid(); |
1609 suggestion->match = prefix_matched_suggestion | 1609 suggestion->match = prefix_matched_suggestion |
1610 ? Suggestion::PREFIX_MATCH | 1610 ? Suggestion::PREFIX_MATCH |
1611 : Suggestion::SUBSTRING_MATCH; | 1611 : Suggestion::SUBSTRING_MATCH; |
1612 | 1612 |
1613 // If the value is the card number, the label is the expiration date. | 1613 // If the value is the card number, the label is the expiration date. |
1614 // Otherwise the label is the card number, or if that is empty the | 1614 // Otherwise the label is the card number, or if that is empty the |
1615 // cardholder name. The label should never repeat the value. | 1615 // cardholder name. The label should never repeat the value. |
1616 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { | 1616 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { |
1617 suggestion->value = credit_card->TypeAndLastFourDigits(); | 1617 if (IsAutofillCreditCardBankNameDisplayExperimentEnabled() && |
| 1618 !credit_card->bank_name().empty()) { |
| 1619 suggestion->value = credit_card->BankNameAndLastFourDigits(); |
| 1620 } else { |
| 1621 suggestion->value = credit_card->TypeAndLastFourDigits(); |
| 1622 } |
1618 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) { | 1623 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) { |
1619 suggestion->label = | 1624 suggestion->label = |
1620 credit_card->GetLastUsedDateForDisplay(app_locale_); | 1625 credit_card->GetLastUsedDateForDisplay(app_locale_); |
1621 } else { | 1626 } else { |
1622 suggestion->label = credit_card->GetInfo( | 1627 suggestion->label = credit_card->GetInfo( |
1623 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); | 1628 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); |
1624 } | 1629 } |
1625 if (IsAutofillCreditCardPopupLayoutExperimentEnabled()) | 1630 if (IsAutofillCreditCardPopupLayoutExperimentEnabled()) |
1626 ModifyAutofillCreditCardSuggestion(suggestion); | 1631 ModifyAutofillCreditCardSuggestion(suggestion); |
1627 } else if (credit_card->number().empty()) { | 1632 } else if (credit_card->number().empty()) { |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); | 2021 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); |
2017 | 2022 |
2018 AutofillMetrics::LogWalletAddressConversionType( | 2023 AutofillMetrics::LogWalletAddressConversionType( |
2019 AutofillMetrics::CONVERTED_ADDRESS_ADDED); | 2024 AutofillMetrics::CONVERTED_ADDRESS_ADDED); |
2020 } | 2025 } |
2021 | 2026 |
2022 return guid; | 2027 return guid; |
2023 } | 2028 } |
2024 | 2029 |
2025 } // namespace autofill | 2030 } // namespace autofill |
OLD | NEW |