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

Unified Diff: components/autofill/core/browser/credit_card.cc

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mobile specific infobar delegate. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/credit_card.cc
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index 232fca5dc92e1fc7b6abd0db7c57add4e5e1eac9..b7c80e28c13d495b98b24e5f34336f69fae61264 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -503,6 +503,15 @@ base::string16 CreditCard::TypeAndLastFourDigits() const {
return type + base::UTF8ToUTF16("\xC2\xA0\xE2\x8B\xAF") + digits;
}
+base::string16 CreditCard::AbbreviatedExpirationDateForDisplay() const {
+ base::string16 month = ExpirationMonthAsString();
+ base::string16 year = Expiration2DigitYearAsString();
+ return month.empty() || year.empty()
+ ? base::string16()
+ : l10n_util::GetStringFUTF16(
+ IDS_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE_ABBR, month, year);
+}
+
void CreditCard::operator=(const CreditCard& credit_card) {
set_use_count(credit_card.use_count());
set_use_date(credit_card.use_date());

Powered by Google App Engine
This is Rietveld 408576698