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

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

Issue 2531223003: Expanded Autofill Credit Card Popup Layout Experiment in Android. (Closed)
Patch Set: Uses format string for expiration date label. Consistently returns 0 as default (non-experiment) va… Created 4 years 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 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 ? Suggestion::PREFIX_MATCH 1614 ? Suggestion::PREFIX_MATCH
1615 : Suggestion::SUBSTRING_MATCH; 1615 : Suggestion::SUBSTRING_MATCH;
1616 1616
1617 // If the value is the card number, the label is the expiration date. 1617 // If the value is the card number, the label is the expiration date.
1618 // Otherwise the label is the card number, or if that is empty the 1618 // Otherwise the label is the card number, or if that is empty the
1619 // cardholder name. The label should never repeat the value. 1619 // cardholder name. The label should never repeat the value.
1620 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { 1620 if (type.GetStorableType() == CREDIT_CARD_NUMBER) {
1621 suggestion->value = credit_card->TypeAndLastFourDigits(); 1621 suggestion->value = credit_card->TypeAndLastFourDigits();
1622 suggestion->label = credit_card->GetInfo( 1622 suggestion->label = credit_card->GetInfo(
1623 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); 1623 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
1624 if (IsAutofillCreditCardPopupLayoutExperimentEnabled())
1625 ModifyAutofillCreditCardSuggestion(suggestion);
1624 } else if (credit_card->number().empty()) { 1626 } else if (credit_card->number().empty()) {
1625 if (type.GetStorableType() != CREDIT_CARD_NAME_FULL) { 1627 if (type.GetStorableType() != CREDIT_CARD_NAME_FULL) {
1626 suggestion->label = credit_card->GetInfo( 1628 suggestion->label = credit_card->GetInfo(
1627 AutofillType(CREDIT_CARD_NAME_FULL), app_locale_); 1629 AutofillType(CREDIT_CARD_NAME_FULL), app_locale_);
1628 } 1630 }
1629 } else { 1631 } else {
1630 #if defined(OS_ANDROID) 1632 #if defined(OS_ANDROID)
1631 // Since Android places the label on its own row, there's more 1633 // Since Android places the label on its own row, there's more
1632 // horizontal 1634 // horizontal
1633 // space to work with. Show "Amex - 1234" rather than desktop's "*1234". 1635 // space to work with. Show "Amex - 1234" rather than desktop's "*1234".
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 if (profile_to_merge->IsVerified()) 1793 if (profile_to_merge->IsVerified())
1792 break; 1794 break;
1793 } 1795 }
1794 } 1796 }
1795 } 1797 }
1796 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe( 1798 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe(
1797 profiles_to_delete->size()); 1799 profiles_to_delete->size());
1798 } 1800 }
1799 1801
1800 } // namespace autofill 1802 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698