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

Side by Side Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 2711543002: Experiment to add bank name in autofill ui. (Closed)
Patch Set: Experiment to add bank name in autofill ui. Created 3 years, 5 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 unified diff | Download patch
OLDNEW
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 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 suggestion->icon = base::UTF8ToUTF16(credit_card->network()); 1667 suggestion->icon = base::UTF8ToUTF16(credit_card->network());
1668 suggestion->backend_id = credit_card->guid(); 1668 suggestion->backend_id = credit_card->guid();
1669 suggestion->match = prefix_matched_suggestion 1669 suggestion->match = prefix_matched_suggestion
1670 ? Suggestion::PREFIX_MATCH 1670 ? Suggestion::PREFIX_MATCH
1671 : Suggestion::SUBSTRING_MATCH; 1671 : Suggestion::SUBSTRING_MATCH;
1672 1672
1673 // If the value is the card number, the label is the expiration date. 1673 // If the value is the card number, the label is the expiration date.
1674 // Otherwise the label is the card number, or if that is empty the 1674 // Otherwise the label is the card number, or if that is empty the
1675 // cardholder name. The label should never repeat the value. 1675 // cardholder name. The label should never repeat the value.
1676 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { 1676 if (type.GetStorableType() == CREDIT_CARD_NUMBER) {
1677 suggestion->value = credit_card->NetworkAndLastFourDigits(); 1677 if (IsAutofillCreditCardBankNameDisplayExperimentEnabled() &&
1678 !credit_card->bank_name().empty()) {
1679 suggestion->value = credit_card->BankNameAndLastFourDigits();
1680 } else {
1681 suggestion->value = credit_card->NetworkAndLastFourDigits();
1682 }
1678 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) { 1683 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) {
1679 suggestion->label = 1684 suggestion->label =
1680 credit_card->GetLastUsedDateForDisplay(app_locale_); 1685 credit_card->GetLastUsedDateForDisplay(app_locale_);
1681 } else { 1686 } else {
1682 suggestion->label = credit_card->GetInfo( 1687 suggestion->label = credit_card->GetInfo(
1683 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); 1688 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
1684 } 1689 }
1685 if (IsAutofillCreditCardPopupLayoutExperimentEnabled()) 1690 if (IsAutofillCreditCardPopupLayoutExperimentEnabled())
1686 ModifyAutofillCreditCardSuggestion(suggestion); 1691 ModifyAutofillCreditCardSuggestion(suggestion);
1687 } else if (credit_card->number().empty()) { 1692 } else if (credit_card->number().empty()) {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); 2081 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email);
2077 2082
2078 AutofillMetrics::LogWalletAddressConversionType( 2083 AutofillMetrics::LogWalletAddressConversionType(
2079 AutofillMetrics::CONVERTED_ADDRESS_ADDED); 2084 AutofillMetrics::CONVERTED_ADDRESS_ADDED);
2080 } 2085 }
2081 2086
2082 return guid; 2087 return guid;
2083 } 2088 }
2084 2089
2085 } // namespace autofill 2090 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698