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

Unified Diff: chrome/browser/autofill/validation.cc

Issue 12213077: [Autofill] Credit Card validation for rAc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 7 years, 10 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/autofill/validation.h ('k') | chrome/browser/autofill/validation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/autofill/validation.h ('k') | chrome/browser/autofill/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698