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

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: card details 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..3d06fe18a977b014f71e69fe98718809ce84136d 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
@@ -22,9 +22,17 @@ AutofillCreditCardFillingInfoBarDelegateMobile::
card_filling_callback_(card_filling_callback),
had_user_interaction_(false),
was_shown_(false),
+#if defined(OS_IOS)
+ // TODO(jdonnelly): Use credit card issuer images on iOS.
Justin Donnelly 2016/08/05 14:45:19 The existing TODO this is copied from is there bec
Mathieu 2016/08/05 16:57:04 I removed the ifdef because it turns out the resou
+ // http://crbug.com/535784
+ issuer_icon_id_(kNoIconID),
+ card_type_(CreditCard::TypeForDisplay(card.type())),
+#else
issuer_icon_id_(CreditCard::IconResourceId(card.type())),
+#endif
card_label_(base::string16(kMidlineEllipsis) + card.LastFourDigits()),
Justin Donnelly 2016/08/05 14:45:19 If we're not going to use icons on iOS, instead of
Mathieu 2016/08/05 16:57:04 Thanks, I should have caught that.
- card_sub_label_(card.AbbreviatedExpirationDateForDisplay()) {}
+ card_sub_label_(card.AbbreviatedExpirationDateForDisplay()) {
Justin Donnelly 2016/08/05 14:45:19 Don't we need the expiration date in the iOS UI?
Mathieu 2016/08/05 16:57:04 It would be nice, and hopefully we get to have the
Justin Donnelly 2016/08/05 18:20:20 I'd say it's must-have not just nice but this is f
+}
AutofillCreditCardFillingInfoBarDelegateMobile::
~AutofillCreditCardFillingInfoBarDelegateMobile() {
@@ -42,8 +50,15 @@ 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_type_,
+ card_label_);
+#endif
}
void AutofillCreditCardFillingInfoBarDelegateMobile::InfoBarDismissed() {

Powered by Google App Engine
This is Rietveld 408576698