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" |
11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 #include "ui/base/models/menu_separator_types.h" |
12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/native_theme/native_theme_export.h" | 14 #include "ui/native_theme/native_theme_export.h" |
14 | 15 |
15 class SkCanvas; | 16 class SkCanvas; |
16 | 17 |
17 namespace gfx { | 18 namespace gfx { |
18 class Rect; | 19 class Rect; |
19 class Size; | 20 class Size; |
20 } | 21 } |
21 | 22 |
(...skipping 27 matching lines...) Expand all Loading... |
49 kFrameTopArea, | 50 kFrameTopArea, |
50 #endif | 51 #endif |
51 kInnerSpinButton, | 52 kInnerSpinButton, |
52 kMenuList, | 53 kMenuList, |
53 kMenuPopupBackground, | 54 kMenuPopupBackground, |
54 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
55 kMenuCheck, | 56 kMenuCheck, |
56 kMenuCheckBackground, | 57 kMenuCheckBackground, |
57 kMenuPopupArrow, | 58 kMenuPopupArrow, |
58 kMenuPopupGutter, | 59 kMenuPopupGutter, |
| 60 #endif |
59 kMenuPopupSeparator, | 61 kMenuPopupSeparator, |
60 #endif | |
61 kMenuItemBackground, | 62 kMenuItemBackground, |
62 kProgressBar, | 63 kProgressBar, |
63 kPushButton, | 64 kPushButton, |
64 kRadio, | 65 kRadio, |
65 | 66 |
66 // The order of the arrow enums is important, do not change without also | 67 // The order of the arrow enums is important, do not change without also |
67 // changing the code in platform implementations. | 68 // changing the code in platform implementations. |
68 kScrollbarDownArrow, | 69 kScrollbarDownArrow, |
69 kScrollbarLeftArrow, | 70 kScrollbarLeftArrow, |
70 kScrollbarRightArrow, | 71 kScrollbarRightArrow, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 bool is_selected; | 139 bool is_selected; |
139 }; | 140 }; |
140 | 141 |
141 struct MenuCheckExtraParams { | 142 struct MenuCheckExtraParams { |
142 bool is_radio; | 143 bool is_radio; |
143 // Used for the disabled state to indicate if the item is both disabled and | 144 // Used for the disabled state to indicate if the item is both disabled and |
144 // selected. | 145 // selected. |
145 bool is_selected; | 146 bool is_selected; |
146 }; | 147 }; |
147 | 148 |
| 149 struct MenuSeparatorExtraParams { |
| 150 const gfx::Rect* paint_rect; |
| 151 MenuSeparatorType type; |
| 152 }; |
| 153 |
148 struct MenuItemExtraParams { | 154 struct MenuItemExtraParams { |
149 bool is_selected; | 155 bool is_selected; |
150 int corner_radius; | 156 int corner_radius; |
151 }; | 157 }; |
152 | 158 |
153 struct MenuListExtraParams { | 159 struct MenuListExtraParams { |
154 bool has_border; | 160 bool has_border; |
155 bool has_border_radius; | 161 bool has_border_radius; |
156 int arrow_x; | 162 int arrow_x; |
157 int arrow_y; | 163 int arrow_y; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 union NATIVE_THEME_EXPORT ExtraParams { | 227 union NATIVE_THEME_EXPORT ExtraParams { |
222 ExtraParams(); | 228 ExtraParams(); |
223 ExtraParams(const ExtraParams& other); | 229 ExtraParams(const ExtraParams& other); |
224 | 230 |
225 ButtonExtraParams button; | 231 ButtonExtraParams button; |
226 FrameTopAreaExtraParams frame_top_area; | 232 FrameTopAreaExtraParams frame_top_area; |
227 InnerSpinButtonExtraParams inner_spin; | 233 InnerSpinButtonExtraParams inner_spin; |
228 MenuArrowExtraParams menu_arrow; | 234 MenuArrowExtraParams menu_arrow; |
229 MenuCheckExtraParams menu_check; | 235 MenuCheckExtraParams menu_check; |
230 MenuItemExtraParams menu_item; | 236 MenuItemExtraParams menu_item; |
| 237 MenuSeparatorExtraParams menu_separator; |
231 MenuListExtraParams menu_list; | 238 MenuListExtraParams menu_list; |
232 MenuBackgroundExtraParams menu_background; | 239 MenuBackgroundExtraParams menu_background; |
233 ProgressBarExtraParams progress_bar; | 240 ProgressBarExtraParams progress_bar; |
234 ScrollbarArrowExtraParams scrollbar_arrow; | 241 ScrollbarArrowExtraParams scrollbar_arrow; |
235 ScrollbarTrackExtraParams scrollbar_track; | 242 ScrollbarTrackExtraParams scrollbar_track; |
236 ScrollbarThumbExtraParams scrollbar_thumb; | 243 ScrollbarThumbExtraParams scrollbar_thumb; |
237 SliderExtraParams slider; | 244 SliderExtraParams slider; |
238 TextFieldExtraParams text_field; | 245 TextFieldExtraParams text_field; |
239 TrackbarExtraParams trackbar; | 246 TrackbarExtraParams trackbar; |
240 }; | 247 }; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 private: | 417 private: |
411 // Observers to notify when the native theme changes. | 418 // Observers to notify when the native theme changes. |
412 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 419 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
413 | 420 |
414 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 421 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
415 }; | 422 }; |
416 | 423 |
417 } // namespace ui | 424 } // namespace ui |
418 | 425 |
419 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 426 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
OLD | NEW |