| 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/credit_card.h" | 5 #include "components/autofill/core/browser/credit_card.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 use_date(), kTimeFormatPatternNoYearShortMonthDate)) | 559 use_date(), kTimeFormatPatternNoYearShortMonthDate)) |
| 560 : l10n_util::GetStringFUTF16( | 560 : l10n_util::GetStringFUTF16( |
| 561 IDS_AUTOFILL_CREDIT_CARD_ADDED_DATE, | 561 IDS_AUTOFILL_CREDIT_CARD_ADDED_DATE, |
| 562 base::TimeFormatWithPattern( | 562 base::TimeFormatWithPattern( |
| 563 use_date(), kTimeFormatPatternNoYearShortMonthDate)); | 563 use_date(), kTimeFormatPatternNoYearShortMonthDate)); |
| 564 } | 564 } |
| 565 | 565 |
| 566 // use_count() > 1 when the card has been used in autofill. | 566 // use_count() > 1 when the card has been used in autofill. |
| 567 | 567 |
| 568 // If the card was last used in autofill more than a year ago, | 568 // If the card was last used in autofill more than a year ago, |
| 569 // display "last used > 1 year ago" without showing date detail. | 569 // display "last used over a year ago" without showing date detail. |
| 570 if ((AutofillClock::Now() - use_date()).InDays() > 365) { | 570 if ((AutofillClock::Now() - use_date()).InDays() > 365) { |
| 571 return show_expiration_date | 571 return show_expiration_date |
| 572 ? l10n_util::GetStringFUTF16( | 572 ? l10n_util::GetStringFUTF16( |
| 573 IDS_AUTOFILL_CREDIT_CARD_EXP_AND_LAST_USED_YEAR_AGO, | 573 IDS_AUTOFILL_CREDIT_CARD_EXP_AND_LAST_USED_YEAR_AGO, |
| 574 GetInfo(AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), | 574 GetInfo(AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), |
| 575 app_locale)) | 575 app_locale)) |
| 576 : l10n_util::GetStringUTF16( | 576 : l10n_util::GetStringUTF16( |
| 577 IDS_AUTOFILL_CREDIT_CARD_LAST_USED_YEAR_AGO); | 577 IDS_AUTOFILL_CREDIT_CARD_LAST_USED_YEAR_AGO); |
| 578 } | 578 } |
| 579 | 579 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 const char kDinersCard[] = "dinersCC"; | 927 const char kDinersCard[] = "dinersCC"; |
| 928 const char kDiscoverCard[] = "discoverCC"; | 928 const char kDiscoverCard[] = "discoverCC"; |
| 929 const char kGenericCard[] = "genericCC"; | 929 const char kGenericCard[] = "genericCC"; |
| 930 const char kJCBCard[] = "jcbCC"; | 930 const char kJCBCard[] = "jcbCC"; |
| 931 const char kMasterCard[] = "masterCardCC"; | 931 const char kMasterCard[] = "masterCardCC"; |
| 932 const char kMirCard[] = "mirCC"; | 932 const char kMirCard[] = "mirCC"; |
| 933 const char kUnionPay[] = "unionPayCC"; | 933 const char kUnionPay[] = "unionPayCC"; |
| 934 const char kVisaCard[] = "visaCC"; | 934 const char kVisaCard[] = "visaCC"; |
| 935 | 935 |
| 936 } // namespace autofill | 936 } // namespace autofill |
| OLD | NEW |