Chromium Code Reviews| 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; |
| } |