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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 12213077: [Autofill] Credit Card validation for rAc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded includes 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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index a32f09bed4b50e5f1b7107cc5eccc79633d28c48..a4341f9b481e75ba2db55757295101a04fa2fa34 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -431,11 +431,33 @@ void AutofillDialogControllerImpl::EditClickedForSection(
bool AutofillDialogControllerImpl::InputIsValid(AutofillFieldType type,
const string16& value) {
- // TODO(groby): Add the missing checks.
switch (type) {
+ case EMAIL_ADDRESS:
+ // TODO(groby): Add the missing check.
+ break;
+
case CREDIT_CARD_NUMBER:
return autofill::IsValidCreditCardNumber(value);
+ case CREDIT_CARD_NAME:
+ break;
+ case CREDIT_CARD_EXP_MONTH:
+ case CREDIT_CARD_EXP_4_DIGIT_YEAR:
+ NOTREACHED(); // Validation is not called for <select>
+ break;
+ case CREDIT_CARD_VERIFICATION_CODE:
+ return autofill::IsValidCreditCardSecurityCode(value);
+
+ case ADDRESS_HOME_LINE1:
+ break;
+ case ADDRESS_HOME_LINE2:
+ return true; // Line 2 is optional - always valid.
+ case ADDRESS_HOME_CITY:
+ case ADDRESS_HOME_STATE:
+ case ADDRESS_HOME_ZIP:
+ break;
+
default:
+ NOTREACHED(); // Trying to validate unknown field.
break;
}
« no previous file with comments | « chrome/browser/autofill/validation_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698