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; |