[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 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 | ||||
3 | // LICENSE file. | ||||
4 | |||||
5 | #ifndef CHROME_VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ | ||||
6 | #define CHROME_VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ | ||||
7 | |||||
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 8 | #include "chrome/views/controls/native_control_win.h" |
9 | #include "chrome/views/controls/button/native_button_wrapper.h" | ||||
10 | |||||
11 | namespace views { | ||||
12 | |||||
13 | // A View that hosts a native Windows button. | ||||
14 | class NativeButtonWin : public NativeControlWin, | ||||
15 | public NativeButtonWrapper { | ||||
16 | public: | ||||
[email protected] | ff9b986c | 2009-03-19 21:18:44 | [diff] [blame^] | 17 | explicit NativeButtonWin(NativeButton2* native_button); |
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 18 | virtual ~NativeButtonWin(); |
19 | |||||
20 | // Overridden from NativeButtonWrapper: | ||||
[email protected] | ff9b986c | 2009-03-19 21:18:44 | [diff] [blame^] | 21 | virtual void UpdateLabel(); |
22 | virtual void UpdateFont(); | ||||
23 | virtual void UpdateDefault(); | ||||
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 24 | virtual View* GetView(); |
25 | |||||
26 | // Overridden from View: | ||||
27 | virtual gfx::Size GetPreferredSize(); | ||||
28 | |||||
29 | // Overridden from NativeControlWin: | ||||
30 | virtual LRESULT ProcessMessage(UINT message, | ||||
31 | WPARAM w_param, | ||||
32 | LPARAM l_param); | ||||
33 | virtual bool OnKeyDown(int vkey); | ||||
34 | |||||
35 | protected: | ||||
36 | virtual bool NotifyOnKeyDown() const; | ||||
37 | virtual void CreateNativeControl(); | ||||
38 | virtual void NativeControlCreated(HWND control_hwnd); | ||||
39 | |||||
40 | private: | ||||
[email protected] | ff9b986c | 2009-03-19 21:18:44 | [diff] [blame^] | 41 | // The NativeButton we are bound to. |
42 | NativeButton2* native_button_; | ||||
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 43 | |
44 | DISALLOW_COPY_AND_ASSIGN(NativeButtonWin); | ||||
45 | }; | ||||
46 | |||||
47 | // A View that hosts a native Windows checkbox. | ||||
48 | class NativeCheckboxWin : public NativeButtonWin { | ||||
49 | public: | ||||
[email protected] | ff9b986c | 2009-03-19 21:18:44 | [diff] [blame^] | 50 | explicit NativeCheckboxWin(Checkbox2* native_button); |
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 51 | virtual ~NativeCheckboxWin(); |
52 | |||||
53 | // Overridden from NativeButtonWrapper: | ||||
[email protected] | ff9b986c | 2009-03-19 21:18:44 | [diff] [blame^] | 54 | virtual void UpdateChecked(); |
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 55 | virtual void SetHighlight(bool highlight); |
56 | |||||
57 | // Overridden from NativeControlWin: | ||||
58 | virtual LRESULT ProcessMessage(UINT message, | ||||
59 | WPARAM w_param, | ||||
60 | LPARAM l_param); | ||||
61 | |||||
62 | protected: | ||||
63 | virtual void CreateNativeControl(); | ||||
64 | virtual void NativeControlCreated(HWND control_hwnd); | ||||
65 | |||||
66 | private: | ||||
[email protected] | ff9b986c | 2009-03-19 21:18:44 | [diff] [blame^] | 67 | // The Checkbox we are bound to. |
68 | Checkbox2* checkbox_; | ||||
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 69 | |
70 | DISALLOW_COPY_AND_ASSIGN(NativeCheckboxWin); | ||||
71 | }; | ||||
72 | |||||
73 | // A View that hosts a native Windows radio button. | ||||
74 | class NativeRadioButtonWin : public NativeCheckboxWin { | ||||
75 | public: | ||||
[email protected] | ff9b986c | 2009-03-19 21:18:44 | [diff] [blame^] | 76 | explicit NativeRadioButtonWin(RadioButton2* radio_button); |
[email protected] | 420949f | 2009-03-18 20:40:34 | [diff] [blame] | 77 | virtual ~NativeRadioButtonWin(); |
78 | |||||
79 | protected: | ||||
80 | // Overridden from NativeCheckboxWin: | ||||
81 | virtual void CreateNativeControl(); | ||||
82 | |||||
83 | private: | ||||
84 | DISALLOW_COPY_AND_ASSIGN(NativeRadioButtonWin); | ||||
85 | }; | ||||
86 | |||||
87 | } // namespace views | ||||
88 | |||||
89 | #endif // #ifndef CHROME_VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ |