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 textfield. Only display an |
20 virtual bool ValidateTextfield(views::Textfield* textfield) = 0; | 20 // error in the UI when |display_error| is true. |
21 virtual bool ValidateTextfield(views::Textfield* textfield, | |
anthonyvd
2017/05/12 14:19:44
I think we should separate the validation logic fr
MAD
2017/05/18 16:01:46
As discussed... OK?
anthonyvd
2017/05/18 18:12:24
Yeah, I like this way better :) Thanks!
| |
22 bool display_error) = 0; | |
21 | 23 |
22 virtual bool ValidateCombobox(views::Combobox* combobox) = 0; | 24 virtual bool ValidateCombobox(views::Combobox* combobox, |
25 bool display_error) = 0; | |
23 virtual void ComboboxModelChanged(views::Combobox* combobox) = 0; | 26 virtual void ComboboxModelChanged(views::Combobox* combobox) = 0; |
24 }; | 27 }; |
25 | 28 |
26 } // namespace payments | 29 } // namespace payments |
27 | 30 |
28 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ | 31 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ |
OLD | NEW |