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

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

Issue 2889453004: [Payments] Use Autofill card assets for Payment Request (Closed)
Patch Set: different amex icon Created 3 years, 7 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_data_util.cc
diff --git a/components/autofill/core/browser/autofill_data_util.cc b/components/autofill/core/browser/autofill_data_util.cc
index e679d581cb9878f0a4f403bfdd71b743d1c95b3d..215b75829bc326ce644595ab7ed7dd90a4923488 100644
--- a/components/autofill/core/browser/autofill_data_util.cc
+++ b/components/autofill/core/browser/autofill_data_util.cc
@@ -25,6 +25,8 @@ namespace {
// Mappings from Chrome card types to Payment Request API basic card payment
// spec types and icons. Note that "generic" is not in the spec.
// https://w3c.github.io/webpayments-methods-card/#method-id
+#if defined(OS_ANDROID)
+// On Android, use the PR-specific resource IDs.
const PaymentRequestData kPaymentRequestData[]{
{"americanExpressCC", "amex", IDR_AUTOFILL_PR_AMEX, IDS_AUTOFILL_CC_AMEX},
{"dinersCC", "diners", IDR_AUTOFILL_PR_DINERS, IDS_AUTOFILL_CC_DINERS},
@@ -40,6 +42,24 @@ const PaymentRequestData kPaymentRequestData[]{
};
const PaymentRequestData kGenericPaymentRequestData = {
"genericCC", "generic", IDR_AUTOFILL_PR_GENERIC, IDS_AUTOFILL_CC_GENERIC};
+#else // !defined(OS_ANDROID)
+// On other platforms, use the Autofill resource IDs.
+const PaymentRequestData kPaymentRequestData[]{
+ {"americanExpressCC", "amex", IDR_AUTOFILL_CC_AMEX, IDS_AUTOFILL_CC_AMEX},
+ {"dinersCC", "diners", IDR_AUTOFILL_CC_DINERS, IDS_AUTOFILL_CC_DINERS},
+ {"discoverCC", "discover", IDR_AUTOFILL_CC_DISCOVER,
+ IDS_AUTOFILL_CC_DISCOVER},
+ {"jcbCC", "jcb", IDR_AUTOFILL_CC_JCB, IDS_AUTOFILL_CC_JCB},
+ {"masterCardCC", "mastercard", IDR_AUTOFILL_CC_MASTERCARD,
+ IDS_AUTOFILL_CC_MASTERCARD},
+ {"mirCC", "mir", IDR_AUTOFILL_CC_MIR, IDS_AUTOFILL_CC_MIR},
+ {"unionPayCC", "unionpay", IDR_AUTOFILL_CC_UNIONPAY,
+ IDS_AUTOFILL_CC_UNION_PAY},
+ {"visaCC", "visa", IDR_AUTOFILL_CC_VISA, IDS_AUTOFILL_CC_VISA},
+};
+const PaymentRequestData kGenericPaymentRequestData = {
+ "genericCC", "generic", IDR_AUTOFILL_CC_GENERIC, IDS_AUTOFILL_CC_GENERIC};
+#endif
const char* const name_prefixes[] = {
"1lt", "1st", "2lt", "2nd", "3rd", "admiral", "capt",

Powered by Google App Engine
This is Rietveld 408576698