| 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_WIN_H_ | 5 #ifndef UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WIN_H_ |
| 6 #define UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WIN_H_ | 6 #define UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WIN_H_ |
| 7 | 7 |
| 8 #include "ui/views/controls/combobox/native_combobox_wrapper.h" | 8 #include "ui/views/controls/combobox/native_combobox_wrapper.h" |
| 9 #include "ui/views/controls/native_control_win.h" | 9 #include "ui/views/controls/native_control_win.h" |
| 10 | 10 |
| 11 namespace views { | 11 namespace views { |
| 12 | 12 |
| 13 class NativeComboboxWin : public NativeControlWin, | 13 class NativeComboboxWin : public NativeControlWin, |
| 14 public NativeComboboxWrapper { | 14 public NativeComboboxWrapper { |
| 15 public: | 15 public: |
| 16 explicit NativeComboboxWin(Combobox* combobox); | 16 explicit NativeComboboxWin(Combobox* combobox); |
| 17 virtual ~NativeComboboxWin(); | 17 virtual ~NativeComboboxWin(); |
| 18 | 18 |
| 19 // Overridden from NativeComboboxWrapper: | 19 // Overridden from NativeComboboxWrapper: |
| 20 virtual void UpdateFromModel() OVERRIDE; | 20 virtual void UpdateFromModel() OVERRIDE; |
| 21 virtual void UpdateSelectedIndex() OVERRIDE; | 21 virtual void UpdateSelectedIndex() OVERRIDE; |
| 22 virtual void UpdateEnabled() OVERRIDE; | 22 virtual void UpdateEnabled() OVERRIDE; |
| 23 virtual int GetSelectedIndex() const OVERRIDE; | 23 virtual int GetSelectedIndex() const OVERRIDE; |
| 24 virtual bool IsDropdownOpen() const OVERRIDE; | 24 virtual bool IsDropdownOpen() const OVERRIDE; |
| 25 virtual gfx::Size GetPreferredSize() OVERRIDE; | 25 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 26 virtual View* GetView() OVERRIDE; | 26 virtual View* GetView() OVERRIDE; |
| 27 virtual void SetFocus() OVERRIDE; | 27 virtual void SetFocus() OVERRIDE; |
| 28 virtual bool HandleKeyPressed(const views::KeyEvent& event) OVERRIDE; | 28 virtual bool HandleKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| 29 virtual bool HandleKeyReleased(const views::KeyEvent& event) OVERRIDE; | 29 virtual bool HandleKeyReleased(const ui::KeyEvent& event) OVERRIDE; |
| 30 virtual void HandleFocus() OVERRIDE; | 30 virtual void HandleFocus() OVERRIDE; |
| 31 virtual void HandleBlur() OVERRIDE; | 31 virtual void HandleBlur() OVERRIDE; |
| 32 virtual gfx::NativeView GetTestingHandle() const OVERRIDE; | 32 virtual gfx::NativeView GetTestingHandle() const OVERRIDE; |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 // Overridden from NativeControlWin: | 35 // Overridden from NativeControlWin: |
| 36 virtual bool ProcessMessage(UINT message, | 36 virtual bool ProcessMessage(UINT message, |
| 37 WPARAM w_param, | 37 WPARAM w_param, |
| 38 LPARAM l_param, | 38 LPARAM l_param, |
| 39 LRESULT* result) OVERRIDE; | 39 LRESULT* result) OVERRIDE; |
| 40 virtual void CreateNativeControl() OVERRIDE; | 40 virtual void CreateNativeControl() OVERRIDE; |
| 41 virtual void NativeControlCreated(HWND native_control) OVERRIDE; | 41 virtual void NativeControlCreated(HWND native_control) OVERRIDE; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 void UpdateFont(); | 44 void UpdateFont(); |
| 45 | 45 |
| 46 // The combobox we are bound to. | 46 // The combobox we are bound to. |
| 47 Combobox* combobox_; | 47 Combobox* combobox_; |
| 48 | 48 |
| 49 // The min width, in pixels, for the text content. | 49 // The min width, in pixels, for the text content. |
| 50 int content_width_; | 50 int content_width_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(NativeComboboxWin); | 52 DISALLOW_COPY_AND_ASSIGN(NativeComboboxWin); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace views | 55 } // namespace views |
| 56 | 56 |
| 57 #endif // UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WIN_H_ | 57 #endif // UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_WIN_H_ |
| OLD | NEW |