Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: views/controls/button/native_button_win.h

Issue 2812026: Auto-size the views version of the options dialog. (Closed)
Patch Set: Fix autosizing issue with gtk pref pages in chromeos options dialog. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | views/controls/button/native_button_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // source code is governed by a BSD-style license that can be found in the 2 // Use of this source code is governed by a BSD-style license that can be
3 // LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ 5 #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_
6 #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ 6 #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_
7 7
8 #include "views/controls/native_control_win.h" 8 #include "views/controls/native_control_win.h"
9 #include "views/controls/button/native_button_wrapper.h" 9 #include "views/controls/button/native_button_wrapper.h"
10 10
11 namespace views { 11 namespace views {
12 12
13 // A View that hosts a native Windows button. 13 // A View that hosts a native Windows button.
(...skipping 28 matching lines...) Expand all
42 virtual void CreateNativeControl(); 42 virtual void CreateNativeControl();
43 virtual void NativeControlCreated(HWND control_hwnd); 43 virtual void NativeControlCreated(HWND control_hwnd);
44 44
45 // Returns true if this button is actually a checkbox or radio button. 45 // Returns true if this button is actually a checkbox or radio button.
46 virtual bool IsCheckbox() const { return false; } 46 virtual bool IsCheckbox() const { return false; }
47 47
48 private: 48 private:
49 // The NativeButton we are bound to. 49 // The NativeButton we are bound to.
50 NativeButton* native_button_; 50 NativeButton* native_button_;
51 51
52 // It's expensive to find the size of a button on windows, so we cache it.
53 mutable gfx::Size button_size_;
54 mutable bool button_size_valid_;
55
52 DISALLOW_COPY_AND_ASSIGN(NativeButtonWin); 56 DISALLOW_COPY_AND_ASSIGN(NativeButtonWin);
53 }; 57 };
54 58
55 // A View that hosts a native Windows checkbox. 59 // A View that hosts a native Windows checkbox.
56 class NativeCheckboxWin : public NativeButtonWin { 60 class NativeCheckboxWin : public NativeButtonWin {
57 public: 61 public:
58 explicit NativeCheckboxWin(Checkbox* native_button); 62 explicit NativeCheckboxWin(Checkbox* native_button);
59 virtual ~NativeCheckboxWin(); 63 virtual ~NativeCheckboxWin();
60 64
61 // Overridden from View: 65 // Overridden from View:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 virtual void CreateNativeControl(); 103 virtual void CreateNativeControl();
100 virtual bool IsRadioButton() const { return true; } 104 virtual bool IsRadioButton() const { return true; }
101 105
102 private: 106 private:
103 DISALLOW_COPY_AND_ASSIGN(NativeRadioButtonWin); 107 DISALLOW_COPY_AND_ASSIGN(NativeRadioButtonWin);
104 }; 108 };
105 109
106 } // namespace views 110 } // namespace views
107 111
108 #endif // #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ 112 #endif // #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | views/controls/button/native_button_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698