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_VALIDATING_COMBOBOX_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Used to keep track of our own destruction. | 27 // Used to keep track of our own destruction. |
28 void ViewHierarchyChanged( | 28 void ViewHierarchyChanged( |
29 const ViewHierarchyChangedDetails& details) override; | 29 const ViewHierarchyChangedDetails& details) override; |
30 | 30 |
31 // Called when the combobox contents is changed. May do validation. | 31 // Called when the combobox contents is changed. May do validation. |
32 void OnContentsChanged(); | 32 void OnContentsChanged(); |
33 | 33 |
34 // ui::ComboboxModelObserver: | 34 // ui::ComboboxModelObserver: |
35 void OnComboboxModelChanged(ui::ComboboxModel* model) override; | 35 void OnComboboxModelChanged(ui::ComboboxModel* model) override; |
36 | 36 |
| 37 // Identifies whether the current content if valid or not. |
| 38 bool IsValid(); |
| 39 |
37 private: | 40 private: |
38 // Will call to the ValidationDelegate to validate the contents of the | 41 // Will call to the ValidationDelegate to validate the contents of the |
39 // combobox. | 42 // combobox. |
40 void Validate(); | 43 void Validate(); |
41 | 44 |
42 std::unique_ptr<ValidationDelegate> delegate_; | 45 std::unique_ptr<ValidationDelegate> delegate_; |
43 bool was_blurred_ = false; | 46 bool was_blurred_ = false; |
44 bool being_removed_ = false; | 47 bool being_removed_ = false; |
45 | 48 |
46 DISALLOW_COPY_AND_ASSIGN(ValidatingCombobox); | 49 DISALLOW_COPY_AND_ASSIGN(ValidatingCombobox); |
47 }; | 50 }; |
48 | 51 |
49 } // namespace payments | 52 } // namespace payments |
50 | 53 |
51 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ | 54 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ |
OLD | NEW |