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

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

Issue 2607043002: [Autofill] Credit Card Autofill Last Used Date Experiment (Closed)
Patch Set: Addressed comments 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 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 suggestion->value = credit_card->TypeAndLastFourDigits();
1610 suggestion->label = credit_card->GetInfo( 1610 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled()) {
1611 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); 1611 suggestion->label =
1612 credit_card->GetLastUsedDateForDisplay(app_locale_);
1613 } else {
1614 suggestion->label = credit_card->GetInfo(
1615 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
1616 }
1612 if (IsAutofillCreditCardPopupLayoutExperimentEnabled()) 1617 if (IsAutofillCreditCardPopupLayoutExperimentEnabled())
1613 ModifyAutofillCreditCardSuggestion(suggestion); 1618 ModifyAutofillCreditCardSuggestion(suggestion);
1614 } else if (credit_card->number().empty()) { 1619 } else if (credit_card->number().empty()) {
1615 if (type.GetStorableType() != CREDIT_CARD_NAME_FULL) { 1620 if (type.GetStorableType() != CREDIT_CARD_NAME_FULL) {
1616 suggestion->label = credit_card->GetInfo( 1621 suggestion->label = credit_card->GetInfo(
1617 AutofillType(CREDIT_CARD_NAME_FULL), app_locale_); 1622 AutofillType(CREDIT_CARD_NAME_FULL), app_locale_);
1618 } 1623 }
1619 } else { 1624 } else {
1620 #if defined(OS_ANDROID) 1625 #if defined(OS_ANDROID)
1621 // Since Android places the label on its own row, there's more 1626 // Since Android places the label on its own row, there's more
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email); 1939 existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email);
1935 1940
1936 AutofillMetrics::LogWalletAddressConversionType( 1941 AutofillMetrics::LogWalletAddressConversionType(
1937 AutofillMetrics::CONVERTED_ADDRESS_ADDED); 1942 AutofillMetrics::CONVERTED_ADDRESS_ADDED);
1938 } 1943 }
1939 1944
1940 return guid; 1945 return guid;
1941 } 1946 }
1942 1947
1943 } // namespace autofill 1948 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698