Index: chrome/browser/autofill/validation.cc |
diff --git a/chrome/browser/autofill/validation.cc b/chrome/browser/autofill/validation.cc |
index ad34b312f7948b54991957b3e2cd356ba3394675..a00721114efdf8f284815fc3dc3ce4a89d621a31 100644 |
--- a/chrome/browser/autofill/validation.cc |
+++ b/chrome/browser/autofill/validation.cc |
@@ -45,4 +45,17 @@ bool IsValidCreditCardNumber(const string16& text) { |
return (sum % 10) == 0; |
} |
+bool IsValidCreditCardSecurityCode(const string16& text) { |
+ if (text.size() < 3U || text.size() > 4U) |
+ return false; |
+ |
+ for (string16::const_iterator iter = text.begin(); |
+ iter != text.end(); |
+ ++iter) { |
+ if (!IsAsciiDigit(*iter)) |
+ return false; |
+ } |
+ return true; |
+} |
+ |
} // namespace autofill |