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

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

Issue 2514753002: Add Mir credit card support to autofill. (Closed)
Patch Set: Remove autofill sync modifications, optimize png files. Created 4 years, 1 month 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 75a34c75a26041143962be118c277e481d00ca4b..376ce1be872a9c0fd94efdabff32d1422b322170 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -72,6 +72,8 @@ base::string16 TypeForFill(const std::string& type) {
return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_JCB);
if (type == kMasterCard)
return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_MASTERCARD);
+ if (type == kMirCard)
+ return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_MIR);
if (type == kUnionPay)
return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_UNION_PAY);
if (type == kVisaCard)
@@ -137,6 +139,8 @@ int CreditCard::IconResourceId(const std::string& type) {
return IDR_AUTOFILL_CC_GENERIC;
if (type == kMasterCard)
return IDR_AUTOFILL_CC_MASTERCARD;
+ if (type == kMirCard)
+ return IDR_AUTOFILL_CC_MIR;
if (type == kUnionPay)
return IDR_AUTOFILL_CC_GENERIC;
if (type == kVisaCard)
@@ -188,6 +192,9 @@ const char* CreditCard::GetCreditCardType(const base::string16& number) {
if (!base::StringToInt(number.substr(0, 2), &first_two_digits))
return kGenericCard;
+ if (first_two_digits == 22)
+ return kMirCard;
+
if (first_two_digits == 34 || first_two_digits == 37)
return kAmericanExpressCard;
@@ -865,6 +872,7 @@ const char kDiscoverCard[] = "discoverCC";
const char kGenericCard[] = "genericCC";
const char kJCBCard[] = "jcbCC";
const char kMasterCard[] = "masterCardCC";
+const char kMirCard[] = "mirCC";
const char kUnionPay[] = "unionPayCC";
const char kVisaCard[] = "visaCC";
« no previous file with comments | « components/autofill/core/browser/credit_card.h ('k') | components/autofill/core/browser/credit_card_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698