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

Unified Diff: chrome/browser/ui/views/payments/editor_view_controller.h

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/editor_view_controller.h
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.h b/chrome/browser/ui/views/payments/editor_view_controller.h
index 216b45cb3880a3c0cfbdc62a6014ed59339b4719..fbe836d9eb2317ca91a08b77d19f5d20754fec3f 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/editor_view_controller.h
@@ -113,7 +113,9 @@ class EditorViewController : public PaymentRequestSheetController,
virtual std::unique_ptr<views::View> CreateHeaderView();
// |focusable_field| is to be set with a pointer to the view that should get
// default focus within the custom view. |valid| should be set to the initial
- // validity state of the custom view.
+ // validity state of the custom view. If a custom view requires model
+ // validation, it should be tracked in |text_fields_| or |comboboxes_| (e.g.,
+ // by using CreateComboboxForField).
virtual std::unique_ptr<views::View> CreateCustomFieldView(
autofill::ServerFieldType type,
views::View** focusable_field,
@@ -129,6 +131,7 @@ class EditorViewController : public PaymentRequestSheetController,
autofill::ServerFieldType type) = 0;
// Validates the data entered and attempts to save; returns true on success.
virtual bool ValidateModelAndSave() = 0;
+
// Creates a ValidationDelegate which knows how to validate for a given
// |field| definition.
virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate(
@@ -136,6 +139,9 @@ class EditorViewController : public PaymentRequestSheetController,
virtual std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType(
const autofill::ServerFieldType& type) = 0;
+ // Returns true if all fields are valid.
+ bool ValidateInputFields();
+
// PaymentRequestSheetController;
std::unique_ptr<views::Button> CreatePrimaryButton() override;
void FillContentView(views::View* content_view) override;

Powered by Google App Engine
This is Rietveld 408576698