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

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

Issue 141843005: rAc: fix some validation issues (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 11 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
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_types.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/validation.cc
diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc
index dc5ddd33bce9a7f0e9bd5447f48f6645bddf92e3..177785d4c6faa06d097ae6555160dfb73dec1aeb 100644
--- a/components/autofill/core/browser/validation.cc
+++ b/components/autofill/core/browser/validation.cc
@@ -128,10 +128,9 @@ bool IsValidCreditCardSecurityCode(const base::string16& text) {
bool IsValidCreditCardSecurityCode(const base::string16& code,
const base::string16& number) {
- CreditCard card;
- card.SetRawInfo(CREDIT_CARD_NUMBER, number);
+ std::string type = CreditCard::GetCreditCardType(number);
size_t required_length = 3;
- if (card.type() == kAmericanExpressCard)
+ if (type == kAmericanExpressCard)
required_length = 4;
return code.length() == required_length;
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698