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

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: Don't show bank name if bank name is empty even though feature flag on 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 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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 suggestion->icon = base::UTF8ToUTF16(credit_card->type()); 1599 suggestion->icon = base::UTF8ToUTF16(credit_card->type());
1600 suggestion->backend_id = credit_card->guid(); 1600 suggestion->backend_id = credit_card->guid();
1601 suggestion->match = prefix_matched_suggestion 1601 suggestion->match = prefix_matched_suggestion
1602 ? Suggestion::PREFIX_MATCH 1602 ? Suggestion::PREFIX_MATCH
1603 : Suggestion::SUBSTRING_MATCH; 1603 : Suggestion::SUBSTRING_MATCH;
1604 1604
1605 // If the value is the card number, the label is the expiration date. 1605 // If the value is the card number, the label is the expiration date.
1606 // Otherwise the label is the card number, or if that is empty the 1606 // Otherwise the label is the card number, or if that is empty the
1607 // cardholder name. The label should never repeat the value. 1607 // cardholder name. The label should never repeat the value.
1608 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { 1608 if (type.GetStorableType() == CREDIT_CARD_NUMBER) {
1609 suggestion->value = credit_card->TypeAndLastFourDigits(); 1609 if (IsAutofillCreditCardBankNameDisplayExperimentEnabled()
1610 && !credit_card->bank_name().empty()) {
1611 suggestion->value = credit_card->BankNameAndLastFourDigits();
1612 } else {
1613 suggestion->value = credit_card->TypeAndLastFourDigits();
1614 }
1610 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) { 1615 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) {
1611 suggestion->label = 1616 suggestion->label =
1612 credit_card->GetLastUsedDateForDisplay(app_locale_); 1617 credit_card->GetLastUsedDateForDisplay(app_locale_);
1613 } else { 1618 } else {
1614 suggestion->label = credit_card->GetInfo( 1619 suggestion->label = credit_card->GetInfo(
1615 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); 1620 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
1616 } 1621 }
1617 if (IsAutofillCreditCardPopupLayoutExperimentEnabled()) 1622 if (IsAutofillCreditCardPopupLayoutExperimentEnabled())
1618 ModifyAutofillCreditCardSuggestion(suggestion); 1623 ModifyAutofillCreditCardSuggestion(suggestion);
1619 } else if (credit_card->number().empty()) { 1624 } else if (credit_card->number().empty()) {
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1939 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); 1944 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email);
1940 1945
1941 AutofillMetrics::LogWalletAddressConversionType( 1946 AutofillMetrics::LogWalletAddressConversionType(
1942 AutofillMetrics::CONVERTED_ADDRESS_ADDED); 1947 AutofillMetrics::CONVERTED_ADDRESS_ADDED);
1943 } 1948 }
1944 1949
1945 return guid; 1950 return guid;
1946 } 1951 }
1947 1952
1948 } // namespace autofill 1953 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698