Index: chrome/browser/autofill/validation.cc |
diff --git a/chrome/browser/autofill/validation.cc b/chrome/browser/autofill/validation.cc |
index ad34b312f7948b54991957b3e2cd356ba3394675..e3123610739da7642471a58c30a215d2005ff881 100644 |
--- a/chrome/browser/autofill/validation.cc |
+++ b/chrome/browser/autofill/validation.cc |
@@ -5,6 +5,9 @@ |
#include "chrome/browser/autofill/validation.h" |
#include "base/string_util.h" |
+#include "base/strings/string_number_conversions.h" |
+#include "base/time.h" |
+#include "base/utf_string_conversions.h" |
Ilya Sherman
2013/02/11 05:39:51
nit: Not needed?
groby-ooo-7-16
2013/02/11 22:47:53
Left over from patch 1 - removed.
On 2013/02/11 05
|
#include "chrome/browser/autofill/credit_card.h" |
namespace autofill { |
@@ -45,4 +48,17 @@ bool IsValidCreditCardNumber(const string16& text) { |
return (sum % 10) == 0; |
} |
+bool IsValidCreditCardCSC(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 |