OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ |
7 | 7 |
8 namespace views { | 8 namespace views { |
9 class Combobox; | 9 class Combobox; |
10 class Textfield; | 10 class Textfield; |
11 } // namespace views | 11 } // namespace views |
12 | 12 |
13 namespace payments { | 13 namespace payments { |
14 | 14 |
15 class ValidationDelegate { | 15 class ValidationDelegate { |
16 public: | 16 public: |
17 virtual ~ValidationDelegate() {} | 17 virtual ~ValidationDelegate() {} |
18 | 18 |
19 // Only the delegate knows how to validate the textfield. | 19 // Only the delegate knows how to validate the input fields. |
20 virtual bool ValidateTextfield(views::Textfield* textfield) = 0; | 20 virtual bool IsValidTextfield(views::Textfield* textfield) = 0; |
| 21 virtual bool IsValidCombobox(views::Combobox* combobox) = 0; |
21 | 22 |
22 virtual bool ValidateCombobox(views::Combobox* combobox) = 0; | 23 // Notifications to let delegate react to input field changes and also let |
| 24 // caller know if the new values are valid. |
| 25 virtual bool TextfieldValueChanged(views::Textfield* textfield) = 0; |
| 26 virtual bool ComboboxValueChanged(views::Combobox* combobox) = 0; |
| 27 |
| 28 // Lets the delegate know that the model of the combobox has changed, e.g., |
| 29 // when it gets filled asynchronously as for the state field. |
23 virtual void ComboboxModelChanged(views::Combobox* combobox) = 0; | 30 virtual void ComboboxModelChanged(views::Combobox* combobox) = 0; |
24 }; | 31 }; |
25 | 32 |
26 } // namespace payments | 33 } // namespace payments |
27 | 34 |
28 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ | 35 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ |
OLD | NEW |