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_NATIVE_THEME_NATIVE_THEME_H_ | 5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_H_ |
6 #define UI_NATIVE_THEME_NATIVE_THEME_H_ | 6 #define UI_NATIVE_THEME_NATIVE_THEME_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // ExtraParams union. Each part that requires more information has its own | 38 // ExtraParams union. Each part that requires more information has its own |
39 // field in the union. | 39 // field in the union. |
40 // | 40 // |
41 // NativeTheme also supports getting the default size of a given part with | 41 // NativeTheme also supports getting the default size of a given part with |
42 // the GetPartSize() method. | 42 // the GetPartSize() method. |
43 class NATIVE_THEME_EXPORT NativeTheme { | 43 class NATIVE_THEME_EXPORT NativeTheme { |
44 public: | 44 public: |
45 // The part to be painted / sized. | 45 // The part to be painted / sized. |
46 enum Part { | 46 enum Part { |
47 kCheckbox, | 47 kCheckbox, |
| 48 kFrameTopArea, |
48 kInnerSpinButton, | 49 kInnerSpinButton, |
49 kMenuList, | 50 kMenuList, |
50 kMenuPopupBackground, | 51 kMenuPopupBackground, |
51 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
52 kMenuCheck, | 53 kMenuCheck, |
53 kMenuCheckBackground, | 54 kMenuCheckBackground, |
54 kMenuPopupArrow, | 55 kMenuPopupArrow, |
55 kMenuPopupGutter, | 56 kMenuPopupGutter, |
56 kMenuPopupSeparator, | 57 kMenuPopupSeparator, |
57 #endif | 58 #endif |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 struct ButtonExtraParams { | 103 struct ButtonExtraParams { |
103 bool checked; | 104 bool checked; |
104 bool indeterminate; // Whether the button state is indeterminate. | 105 bool indeterminate; // Whether the button state is indeterminate. |
105 bool is_default; // Whether the button is default button. | 106 bool is_default; // Whether the button is default button. |
106 bool is_focused; | 107 bool is_focused; |
107 bool has_border; | 108 bool has_border; |
108 int classic_state; // Used on Windows when uxtheme is not available. | 109 int classic_state; // Used on Windows when uxtheme is not available. |
109 SkColor background_color; | 110 SkColor background_color; |
110 }; | 111 }; |
111 | 112 |
| 113 struct FrameTopAreaExtraParams { |
| 114 // Distinguishes between active (foreground) and inactive |
| 115 // (background) window frame styles. |
| 116 bool is_active; |
| 117 bool incognito; |
| 118 // True when Chromium renders the titlebar. False when the window |
| 119 // manager renders the titlebar. |
| 120 bool use_custom_frame; |
| 121 // If the NativeTheme will paint a solid color, it should use |
| 122 // |default_background_color|. |
| 123 SkColor default_background_color; |
| 124 }; |
| 125 |
112 struct InnerSpinButtonExtraParams { | 126 struct InnerSpinButtonExtraParams { |
113 bool spin_up; | 127 bool spin_up; |
114 bool read_only; | 128 bool read_only; |
115 int classic_state; // Used on Windows when uxtheme is not available. | 129 int classic_state; // Used on Windows when uxtheme is not available. |
116 }; | 130 }; |
117 | 131 |
118 struct MenuArrowExtraParams { | 132 struct MenuArrowExtraParams { |
119 bool pointing_right; | 133 bool pointing_right; |
120 // Used for the disabled state to indicate if the item is both disabled and | 134 // Used for the disabled state to indicate if the item is both disabled and |
121 // selected. | 135 // selected. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 struct TrackbarExtraParams { | 214 struct TrackbarExtraParams { |
201 bool vertical; | 215 bool vertical; |
202 int classic_state; // Used on Windows when uxtheme is not available. | 216 int classic_state; // Used on Windows when uxtheme is not available. |
203 }; | 217 }; |
204 | 218 |
205 union NATIVE_THEME_EXPORT ExtraParams { | 219 union NATIVE_THEME_EXPORT ExtraParams { |
206 ExtraParams(); | 220 ExtraParams(); |
207 ExtraParams(const ExtraParams& other); | 221 ExtraParams(const ExtraParams& other); |
208 | 222 |
209 ButtonExtraParams button; | 223 ButtonExtraParams button; |
| 224 FrameTopAreaExtraParams frame_top_area; |
210 InnerSpinButtonExtraParams inner_spin; | 225 InnerSpinButtonExtraParams inner_spin; |
211 MenuArrowExtraParams menu_arrow; | 226 MenuArrowExtraParams menu_arrow; |
212 MenuCheckExtraParams menu_check; | 227 MenuCheckExtraParams menu_check; |
213 MenuItemExtraParams menu_item; | 228 MenuItemExtraParams menu_item; |
214 MenuListExtraParams menu_list; | 229 MenuListExtraParams menu_list; |
215 MenuBackgroundExtraParams menu_background; | 230 MenuBackgroundExtraParams menu_background; |
216 ProgressBarExtraParams progress_bar; | 231 ProgressBarExtraParams progress_bar; |
217 ScrollbarArrowExtraParams scrollbar_arrow; | 232 ScrollbarArrowExtraParams scrollbar_arrow; |
218 ScrollbarTrackExtraParams scrollbar_track; | 233 ScrollbarTrackExtraParams scrollbar_track; |
219 ScrollbarThumbExtraParams scrollbar_thumb; | 234 ScrollbarThumbExtraParams scrollbar_thumb; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 private: | 402 private: |
388 // Observers to notify when the native theme changes. | 403 // Observers to notify when the native theme changes. |
389 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 404 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
390 | 405 |
391 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 406 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
392 }; | 407 }; |
393 | 408 |
394 } // namespace ui | 409 } // namespace ui |
395 | 410 |
396 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 411 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
OLD | NEW |