Chromium Code Reviews| Index: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| index 0068ad31e81f79f8d18e854686b9fbab46418ec7..9498ea01487221794f3856f6baa454df5a17dda8 100644 |
| --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| @@ -389,21 +389,20 @@ bool CreditCardEditorViewController::ValidateModelAndSave() { |
| autofill::CreditCard credit_card; |
| credit_card.set_origin(autofill::kSettingsOrigin); |
| + if (!ValidateModel()) { |
|
Mathieu
2017/05/31 17:50:17
no curlies are needed
|
| + return false; |
| + } |
| + |
| for (const auto& field : text_fields()) { |
| // ValidatingTextfield* is the key, EditorField is the value. |
| DCHECK_EQ(autofill::CREDIT_CARD, |
| autofill::AutofillType(field.second.type).group()); |
| - if (field.first->invalid()) |
| - return false; |
| - |
| credit_card.SetInfo(autofill::AutofillType(field.second.type), |
| field.first->text(), locale); |
| } |
| for (const auto& field : comboboxes()) { |
| // ValidatingCombobox* is the key, EditorField is the value. |
| ValidatingCombobox* combobox = field.first; |
| - if (combobox->invalid()) |
| - return false; |
| if (field.second.type == kBillingAddressType) { |
| autofill::AddressComboboxModel* model = |