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

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

Issue 2212063002: [Autofill] Implement Autofill Assistant infobar for iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ifdef Created 4 years, 4 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/autofill_credit_card_filling_infobar_delegate_mobile.cc
diff --git a/components/autofill/core/browser/autofill_credit_card_filling_infobar_delegate_mobile.cc b/components/autofill/core/browser/autofill_credit_card_filling_infobar_delegate_mobile.cc
index 432bb262becf4bb2ec5a594c2d22a3a73b09b7e5..c79d465c41dbfb344886ffdb9941910403cbd069 100644
--- a/components/autofill/core/browser/autofill_credit_card_filling_infobar_delegate_mobile.cc
+++ b/components/autofill/core/browser/autofill_credit_card_filling_infobar_delegate_mobile.cc
@@ -23,8 +23,13 @@ AutofillCreditCardFillingInfoBarDelegateMobile::
had_user_interaction_(false),
was_shown_(false),
issuer_icon_id_(CreditCard::IconResourceId(card.type())),
+#if defined(OS_IOS)
+ card_label_(card.TypeAndLastFourDigits()),
+#else
card_label_(base::string16(kMidlineEllipsis) + card.LastFourDigits()),
- card_sub_label_(card.AbbreviatedExpirationDateForDisplay()) {}
+#endif
+ card_sub_label_(card.AbbreviatedExpirationDateForDisplay()) {
+}
AutofillCreditCardFillingInfoBarDelegateMobile::
~AutofillCreditCardFillingInfoBarDelegateMobile() {
@@ -42,8 +47,14 @@ int AutofillCreditCardFillingInfoBarDelegateMobile::GetIconId() const {
base::string16 AutofillCreditCardFillingInfoBarDelegateMobile::GetMessageText()
const {
+#if defined(OS_ANDROID)
return l10n_util::GetStringUTF16(
IDS_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_TITLE);
+#elif defined(OS_IOS)
+ // On iOS the card details are in the title of the infobar.
+ return l10n_util::GetStringFUTF16(
+ IDS_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_FORMATTED_TITLE, card_label_);
+#endif
}
void AutofillCreditCardFillingInfoBarDelegateMobile::InfoBarDismissed() {
« no previous file with comments | « components/autofill/core/browser/autofill_assistant.cc ('k') | components/autofill/core/browser/autofill_experiments.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698