| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ | 5 #ifndef VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ |
| 6 #define VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ | 6 #define VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ |
| 7 | 7 |
| 8 #include "base/gfx/native_widget_types.h" |
| 9 |
| 8 namespace gfx{ | 10 namespace gfx{ |
| 9 class Size; | 11 class Size; |
| 10 } | 12 } |
| 11 | 13 |
| 12 namespace views { | 14 namespace views { |
| 13 | 15 |
| 14 class Combobox; | 16 class Combobox; |
| 15 class View; | 17 class View; |
| 16 | 18 |
| 17 class NativeComboboxWrapper { | 19 class NativeComboboxWrapper { |
| 18 public: | 20 public: |
| 19 // Updates the combobox's content from its model. | 21 // Updates the combobox's content from its model. |
| 20 virtual void UpdateFromModel() = 0; | 22 virtual void UpdateFromModel() = 0; |
| 21 | 23 |
| 22 // Updates the displayed selected item from the associated Combobox. | 24 // Updates the displayed selected item from the associated Combobox. |
| 23 virtual void UpdateSelectedItem() = 0; | 25 virtual void UpdateSelectedItem() = 0; |
| 24 | 26 |
| 25 // Updates the enabled state of the combobox from the associated view. | 27 // Updates the enabled state of the combobox from the associated view. |
| 26 virtual void UpdateEnabled() = 0; | 28 virtual void UpdateEnabled() = 0; |
| 27 | 29 |
| 28 // Gets the selected index. | 30 // Gets the selected index. |
| 29 virtual int GetSelectedItem() const = 0; | 31 virtual int GetSelectedItem() const = 0; |
| 30 | 32 |
| 31 // Returns true if the Combobox dropdown is open. | 33 // Returns true if the Combobox dropdown is open. |
| 32 virtual bool IsDropdownOpen() const = 0; | 34 virtual bool IsDropdownOpen() const = 0; |
| 33 | 35 |
| 34 // Returns the preferred size of the combobox. | 36 // Returns the preferred size of the combobox. |
| 35 virtual gfx::Size GetPreferredSize() const = 0; | 37 virtual gfx::Size GetPreferredSize() const = 0; |
| 36 | 38 |
| 37 // Retrieves the views::View that hosts the native control. | 39 // Retrieves the views::View that hosts the native control. |
| 38 virtual View* GetView() = 0; | 40 virtual View* GetView() = 0; |
| 39 | 41 |
| 40 // Sets the focus to the button. | 42 // Sets the focus to the button. |
| 41 virtual void SetFocus() = 0; | 43 virtual void SetFocus() = 0; |
| 42 | 44 |
| 45 // Returns a handle to the underlying native view for testing. |
| 46 virtual gfx::NativeView GetTestingHandle() const = 0; |
| 47 |
| 43 static NativeComboboxWrapper* CreateWrapper(Combobox* combobox); | 48 static NativeComboboxWrapper* CreateWrapper(Combobox* combobox); |
| 44 }; | 49 }; |
| 45 | 50 |
| 46 } // namespace views | 51 } // namespace views |
| 47 | 52 |
| 48 #endif // VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ | 53 #endif // VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ |
| OLD | NEW |