Chromium Code Reviews| 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 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1617 suggestion->backend_id = credit_card->guid(); | 1617 suggestion->backend_id = credit_card->guid(); |
| 1618 suggestion->match = prefix_matched_suggestion | 1618 suggestion->match = prefix_matched_suggestion |
| 1619 ? Suggestion::PREFIX_MATCH | 1619 ? Suggestion::PREFIX_MATCH |
| 1620 : Suggestion::SUBSTRING_MATCH; | 1620 : Suggestion::SUBSTRING_MATCH; |
| 1621 | 1621 |
| 1622 // If the value is the card number, the label is the expiration date. | 1622 // If the value is the card number, the label is the expiration date. |
| 1623 // Otherwise the label is the card number, or if that is empty the | 1623 // Otherwise the label is the card number, or if that is empty the |
| 1624 // cardholder name. The label should never repeat the value. | 1624 // cardholder name. The label should never repeat the value. |
| 1625 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { | 1625 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { |
| 1626 suggestion->value = credit_card->TypeAndLastFourDigits(); | 1626 suggestion->value = credit_card->TypeAndLastFourDigits(); |
| 1627 suggestion->label = credit_card->GetInfo( | 1627 if (IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() && |
| 1628 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); | 1628 !IsKeyboardAccessoryEnabled()) { |
|
rkaplow
2017/01/09 21:54:17
if !IsKeyboardAccessoryEnabled(), do we want the u
jiahuiguo
2017/01/18 00:13:45
We will adopt the keyboard accessory in later expe
| |
| 1629 suggestion->label = credit_card->LastUsedDateAsString(); | |
|
csashi
2017/01/03 20:54:06
Is the intent of the experiment to display last us
jiahuiguo
2017/01/18 00:13:45
It was, but after discussion with Alex, we may not
| |
| 1630 } else { | |
| 1631 suggestion->label = credit_card->GetInfo( | |
| 1632 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); | |
| 1633 } | |
| 1629 if (IsAutofillCreditCardPopupLayoutExperimentEnabled()) | 1634 if (IsAutofillCreditCardPopupLayoutExperimentEnabled()) |
| 1630 ModifyAutofillCreditCardSuggestion(suggestion); | 1635 ModifyAutofillCreditCardSuggestion(suggestion); |
| 1631 } else if (credit_card->number().empty()) { | 1636 } else if (credit_card->number().empty()) { |
| 1632 if (type.GetStorableType() != CREDIT_CARD_NAME_FULL) { | 1637 if (type.GetStorableType() != CREDIT_CARD_NAME_FULL) { |
| 1633 suggestion->label = credit_card->GetInfo( | 1638 suggestion->label = credit_card->GetInfo( |
| 1634 AutofillType(CREDIT_CARD_NAME_FULL), app_locale_); | 1639 AutofillType(CREDIT_CARD_NAME_FULL), app_locale_); |
| 1635 } | 1640 } |
| 1636 } else { | 1641 } else { |
| 1637 #if defined(OS_ANDROID) | 1642 #if defined(OS_ANDROID) |
| 1638 // Since Android places the label on its own row, there's more | 1643 // Since Android places the label on its own row, there's more |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1853 } | 1858 } |
| 1854 | 1859 |
| 1855 // If the card was modified, apply the changes to the database. | 1860 // If the card was modified, apply the changes to the database. |
| 1856 if (was_modified) { | 1861 if (was_modified) { |
| 1857 database_->UpdateCreditCard(*credit_card); | 1862 database_->UpdateCreditCard(*credit_card); |
| 1858 } | 1863 } |
| 1859 } | 1864 } |
| 1860 } | 1865 } |
| 1861 | 1866 |
| 1862 } // namespace autofill | 1867 } // namespace autofill |
| OLD | NEW |