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

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: 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 0f687368e28d1f41b877715f4ed5d7108d737e58..1fae977b32d14d2c04939e1d763f54eda434a78b 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -433,10 +433,26 @@ void AutofillDialogControllerImpl::EditClickedForSection(
bool AutofillDialogControllerImpl::InputIsValid(AutofillFieldType type,
const string16& value) {
+ using base::Time;
// TODO(groby): Add the missing checks.
switch (type) {
+ case CREDIT_CARD_NAME: break;
case CREDIT_CARD_NUMBER:
return autofill::IsValidCreditCardNumber(value);
+ case CREDIT_CARD_EXP_MONTH:
+ // TODO(groby): Cross-field dependency, needs year. Cannot validate.
+ break;
+ case CREDIT_CARD_EXP_2_DIGIT_YEAR:
Evan Stade 2013/02/08 15:48:14 You only need to handle the types in Show()
groby-ooo-7-16 2013/02/09 00:01:49 Done. Added NOTREACHED default to make clear thi
+ return autofill::IsValidCreditCardExpirationYear(value, 2, Time::Now());
+ case CREDIT_CARD_EXP_4_DIGIT_YEAR:
+ return autofill::IsValidCreditCardExpirationYear(value, 4, Time::Now());
+ case CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR:
+ return autofill::IsValidCreditCardExpirationDate(value, 4, Time::Now());
+ case CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR:
+ return autofill::IsValidCreditCardExpirationDate(value, 4, Time::Now());
+ case CREDIT_CARD_VERIFICATION_CODE:
+ // TODO(groby):: Cross-field dependency - would work better w/ CC type.
+ return autofill::IsValidCreditCardCSC(value);
default:
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