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

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: 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
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 aa556a7ed4533598a0287a312c56866bbab1c57e..7c953a1de06c05918ede198a8b3b3e59e12bd487 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -433,11 +433,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;
}
« chrome/browser/autofill/validation.cc ('K') | « chrome/browser/autofill/validation_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698