Chromium Code Reviews| Index: chrome/browser/autofill/validation.cc |
| diff --git a/chrome/browser/autofill/validation.cc b/chrome/browser/autofill/validation.cc |
| index ad34b312f7948b54991957b3e2cd356ba3394675..a821224ee09e56b694d268e1a4f3b61566c55c07 100644 |
| --- a/chrome/browser/autofill/validation.cc |
| +++ b/chrome/browser/autofill/validation.cc |
| @@ -5,6 +5,8 @@ |
| #include "chrome/browser/autofill/validation.h" |
| #include "base/string_util.h" |
| +#include "base/strings/string_number_conversions.h" |
| +#include "base/time.h" |
|
Ilya Sherman
2013/02/11 22:55:10
nit: Both of these #includes look like they are no
groby-ooo-7-16
2013/02/11 23:27:07
Oops, sorry. Done.
On 2013/02/11 22:55:10, Ilya Sh
|
| #include "chrome/browser/autofill/credit_card.h" |
| namespace autofill { |
| @@ -45,4 +47,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 |