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

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

Issue 2844463004: Rename card 'type' into 'issuer network.' (Closed)
Patch Set: read -> use Created 3 years, 8 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/validation.cc
diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc
index fc15a8d940eae70c0923b6cf1ba4f8fc6dbcf407..cbab098922462f26923b3cfa2230f9f614014696 100644
--- a/components/autofill/core/browser/validation.cc
+++ b/components/autofill/core/browser/validation.cc
@@ -51,7 +51,7 @@ bool IsValidCreditCardNumber(const base::string16& text) {
// [1] http://www.merriampark.com/anatomycc.htm
// [2] http://en.wikipedia.org/wiki/Bank_card_number
// CardEditor.isCardNumberLengthMaxium() needs to be kept in sync.
- const char* const type = CreditCard::GetCreditCardType(text);
+ const char* const type = CreditCard::GetCardNetwork(text);
if (type == kAmericanExpressCard && number.size() != 15)
return false;
if (type == kDinersCard && number.size() != 14)
@@ -107,11 +107,11 @@ bool IsValidCreditCardNumberForBasicCardNetworks(
DCHECK(error_message);
// The type check is cheaper than the credit card number check.
- const std::string basic_card_payment_type =
+ const std::string basic_card_issuer_network =
autofill::data_util::GetPaymentRequestData(
- CreditCard::GetCreditCardType(text))
- .basic_card_payment_type;
- if (!supported_basic_card_networks.count(basic_card_payment_type)) {
+ CreditCard::GetCardNetwork(text))
+ .basic_card_issuer_network;
+ if (!supported_basic_card_networks.count(basic_card_issuer_network)) {
*error_message = l10n_util::GetStringUTF16(
IDS_PAYMENTS_VALIDATION_UNSUPPORTED_CREDIT_CARD_TYPE);
return false;
« no previous file with comments | « components/autofill/core/browser/validation.h ('k') | components/autofill/core/browser/webdata/autofill_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698