Chromium Code Reviews| 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 bool is_active; | |
| 115 SkColor default_background_color; // The theme can ignore this color. | |
|
Tom (Use chromium acct)
2017/01/11 20:07:27
pkasting@: I was thinking of alternative ways to
Peter Kasting
2017/01/12 18:53:53
I think if I were going to change this, it would b
Tom (Use chromium acct)
2017/01/12 21:51:09
Changed the comment, hopefully this one's better
| |
| 116 }; | |
| 117 | |
| 112 struct InnerSpinButtonExtraParams { | 118 struct InnerSpinButtonExtraParams { |
| 113 bool spin_up; | 119 bool spin_up; |
| 114 bool read_only; | 120 bool read_only; |
| 115 int classic_state; // Used on Windows when uxtheme is not available. | 121 int classic_state; // Used on Windows when uxtheme is not available. |
| 116 }; | 122 }; |
| 117 | 123 |
| 118 struct MenuArrowExtraParams { | 124 struct MenuArrowExtraParams { |
| 119 bool pointing_right; | 125 bool pointing_right; |
| 120 // Used for the disabled state to indicate if the item is both disabled and | 126 // Used for the disabled state to indicate if the item is both disabled and |
| 121 // selected. | 127 // selected. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 struct TrackbarExtraParams { | 206 struct TrackbarExtraParams { |
| 201 bool vertical; | 207 bool vertical; |
| 202 int classic_state; // Used on Windows when uxtheme is not available. | 208 int classic_state; // Used on Windows when uxtheme is not available. |
| 203 }; | 209 }; |
| 204 | 210 |
| 205 union NATIVE_THEME_EXPORT ExtraParams { | 211 union NATIVE_THEME_EXPORT ExtraParams { |
| 206 ExtraParams(); | 212 ExtraParams(); |
| 207 ExtraParams(const ExtraParams& other); | 213 ExtraParams(const ExtraParams& other); |
| 208 | 214 |
| 209 ButtonExtraParams button; | 215 ButtonExtraParams button; |
| 216 FrameTopAreaExtraParams frame_top_area; | |
| 210 InnerSpinButtonExtraParams inner_spin; | 217 InnerSpinButtonExtraParams inner_spin; |
| 211 MenuArrowExtraParams menu_arrow; | 218 MenuArrowExtraParams menu_arrow; |
| 212 MenuCheckExtraParams menu_check; | 219 MenuCheckExtraParams menu_check; |
| 213 MenuItemExtraParams menu_item; | 220 MenuItemExtraParams menu_item; |
| 214 MenuListExtraParams menu_list; | 221 MenuListExtraParams menu_list; |
| 215 MenuBackgroundExtraParams menu_background; | 222 MenuBackgroundExtraParams menu_background; |
| 216 ProgressBarExtraParams progress_bar; | 223 ProgressBarExtraParams progress_bar; |
| 217 ScrollbarArrowExtraParams scrollbar_arrow; | 224 ScrollbarArrowExtraParams scrollbar_arrow; |
| 218 ScrollbarTrackExtraParams scrollbar_track; | 225 ScrollbarTrackExtraParams scrollbar_track; |
| 219 ScrollbarThumbExtraParams scrollbar_thumb; | 226 ScrollbarThumbExtraParams scrollbar_thumb; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 387 private: | 394 private: |
| 388 // Observers to notify when the native theme changes. | 395 // Observers to notify when the native theme changes. |
| 389 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 396 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
| 390 | 397 |
| 391 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 398 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
| 392 }; | 399 }; |
| 393 | 400 |
| 394 } // namespace ui | 401 } // namespace ui |
| 395 | 402 |
| 396 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 403 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
| OLD | NEW |