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

Unified Diff: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc

Issue 2905733002: [WebPayments] Disabling done button when form invalid (Closed)
Patch Set: nits Created 3 years, 7 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/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..e32b8d084be8e527d30d5c8ec091001ffca8b12a 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,19 @@ bool CreditCardEditorViewController::ValidateModelAndSave() {
autofill::CreditCard credit_card;
credit_card.set_origin(autofill::kSettingsOrigin);
+ if (!ValidateInputFields())
+ 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 =

Powered by Google App Engine
This is Rietveld 408576698