| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ |
| 6 #define UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ | 6 #define UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
| 9 #include "ui/views/views_export.h" | 9 #include "ui/views/views_export.h" |
| 10 | 10 |
| 11 namespace gfx{ | 11 namespace gfx { |
| 12 class Size; | 12 class Size; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace ui { |
| 16 class KeyEvent; |
| 17 } |
| 18 |
| 15 namespace views { | 19 namespace views { |
| 16 | 20 |
| 17 class Combobox; | 21 class Combobox; |
| 18 class KeyEvent; | |
| 19 class View; | 22 class View; |
| 20 | 23 |
| 21 class VIEWS_EXPORT NativeComboboxWrapper { | 24 class VIEWS_EXPORT NativeComboboxWrapper { |
| 22 public: | 25 public: |
| 23 // Updates the combobox's content from its model. | 26 // Updates the combobox's content from its model. |
| 24 virtual void UpdateFromModel() = 0; | 27 virtual void UpdateFromModel() = 0; |
| 25 | 28 |
| 26 // Updates the selected index from the associated combobox. | 29 // Updates the selected index from the associated combobox. |
| 27 virtual void UpdateSelectedIndex() = 0; | 30 virtual void UpdateSelectedIndex() = 0; |
| 28 | 31 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 40 | 43 |
| 41 // Retrieves the view that hosts the native control. | 44 // Retrieves the view that hosts the native control. |
| 42 virtual View* GetView() = 0; | 45 virtual View* GetView() = 0; |
| 43 | 46 |
| 44 // Sets the focus to the button. | 47 // Sets the focus to the button. |
| 45 virtual void SetFocus() = 0; | 48 virtual void SetFocus() = 0; |
| 46 | 49 |
| 47 // Invoked when a key is pressed/release on combobox. Subclasser should | 50 // Invoked when a key is pressed/release on combobox. Subclasser should |
| 48 // return true if the event has been processed and false otherwise. | 51 // return true if the event has been processed and false otherwise. |
| 49 // See also View::OnKeyPressed/OnKeyReleased. | 52 // See also View::OnKeyPressed/OnKeyReleased. |
| 50 virtual bool HandleKeyPressed(const views::KeyEvent& e) = 0; | 53 virtual bool HandleKeyPressed(const ui::KeyEvent& e) = 0; |
| 51 virtual bool HandleKeyReleased(const views::KeyEvent& e) = 0; | 54 virtual bool HandleKeyReleased(const ui::KeyEvent& e) = 0; |
| 52 | 55 |
| 53 // Invoked when focus is being moved from or to the combobox. | 56 // Invoked when focus is being moved from or to the combobox. |
| 54 // See also View::OnFocus/OnBlur. | 57 // See also View::OnFocus/OnBlur. |
| 55 virtual void HandleFocus() = 0; | 58 virtual void HandleFocus() = 0; |
| 56 virtual void HandleBlur() = 0; | 59 virtual void HandleBlur() = 0; |
| 57 | 60 |
| 58 // Returns a handle to the underlying native view for testing. | 61 // Returns a handle to the underlying native view for testing. |
| 59 virtual gfx::NativeView GetTestingHandle() const = 0; | 62 virtual gfx::NativeView GetTestingHandle() const = 0; |
| 60 | 63 |
| 61 static NativeComboboxWrapper* CreateWrapper(Combobox* combobox); | 64 static NativeComboboxWrapper* CreateWrapper(Combobox* combobox); |
| 62 | 65 |
| 63 protected: | 66 protected: |
| 64 virtual ~NativeComboboxWrapper() {} | 67 virtual ~NativeComboboxWrapper() {} |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace views | 70 } // namespace views |
| 68 | 71 |
| 69 #endif // UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ | 72 #endif // UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WRAPPER_H_ |
| OLD | NEW |