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

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

Issue 16254010: [Autofill] Update credit card type detection logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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/credit_card.h
diff --git a/components/autofill/core/browser/credit_card.h b/components/autofill/core/browser/credit_card.h
index 217d07b91afd31264d22f4e7b221f510cc9ba549..7b13aedf77de010cf9b139fcbd9f4c1d5b556bf4 100644
--- a/components/autofill/core/browser/credit_card.h
+++ b/components/autofill/core/browser/credit_card.h
@@ -37,7 +37,13 @@ class CreditCard : public AutofillDataModel {
// The ResourceBundle ID for the appropriate credit card image.
static int IconResourceId(const std::string& type);
- // The internal representation of credit card type.
+ // Returns the internal representation of credit card type corresponding to
+ // the given |number|. The credit card type is determined purely according to
+ // the Issuer Identification Number (IIN), a.k.a. the "Bank Identification
+ // Number (BIN)", which is parsed from the relevant prefix of the |number|.
+ // This function performs no additional validation checks on the |number|.
+ // Hence, the returned type for both the valid card "4111-1111-1111-1111" and
+ // the invalid card "4garbage" will be Visa, which has an IIN of 4.
static std::string GetCreditCardType(const base::string16& number);
// FormGroup:
@@ -155,7 +161,6 @@ extern const char* const kDiscoverCard;
extern const char* const kGenericCard;
extern const char* const kJCBCard;
extern const char* const kMasterCard;
-extern const char* const kSoloCard;
extern const char* const kVisaCard;
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autofill_manager_unittest.cc ('k') | components/autofill/core/browser/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698