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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 int track_y; | 168 int track_y; |
169 int track_width; | 169 int track_width; |
170 int track_height; | 170 int track_height; |
171 int classic_state; // Used on Windows when uxtheme is not available. | 171 int classic_state; // Used on Windows when uxtheme is not available. |
172 }; | 172 }; |
173 | 173 |
174 struct ScrollbarThumbExtraParams { | 174 struct ScrollbarThumbExtraParams { |
175 bool is_hovering; | 175 bool is_hovering; |
176 }; | 176 }; |
177 | 177 |
| 178 enum ScrollbarOverlayStyle { |
| 179 ScrollbarOverlayStyleDefault, |
| 180 ScrollbarOverlayStyleDark, |
| 181 ScrollbarOverlayStyleLight |
| 182 }; |
| 183 |
178 struct SliderExtraParams { | 184 struct SliderExtraParams { |
179 bool vertical; | 185 bool vertical; |
180 bool in_drag; | 186 bool in_drag; |
181 }; | 187 }; |
182 | 188 |
183 struct TextFieldExtraParams { | 189 struct TextFieldExtraParams { |
184 bool is_text_area; | 190 bool is_text_area; |
185 bool is_listbox; | 191 bool is_listbox; |
186 SkColor background_color; | 192 SkColor background_color; |
187 bool is_read_only; | 193 bool is_read_only; |
(...skipping 16 matching lines...) Expand all Loading... |
204 InnerSpinButtonExtraParams inner_spin; | 210 InnerSpinButtonExtraParams inner_spin; |
205 MenuArrowExtraParams menu_arrow; | 211 MenuArrowExtraParams menu_arrow; |
206 MenuCheckExtraParams menu_check; | 212 MenuCheckExtraParams menu_check; |
207 MenuItemExtraParams menu_item; | 213 MenuItemExtraParams menu_item; |
208 MenuListExtraParams menu_list; | 214 MenuListExtraParams menu_list; |
209 MenuBackgroundExtraParams menu_background; | 215 MenuBackgroundExtraParams menu_background; |
210 ProgressBarExtraParams progress_bar; | 216 ProgressBarExtraParams progress_bar; |
211 ScrollbarArrowExtraParams scrollbar_arrow; | 217 ScrollbarArrowExtraParams scrollbar_arrow; |
212 ScrollbarTrackExtraParams scrollbar_track; | 218 ScrollbarTrackExtraParams scrollbar_track; |
213 ScrollbarThumbExtraParams scrollbar_thumb; | 219 ScrollbarThumbExtraParams scrollbar_thumb; |
| 220 ScrollbarOverlayStyle scrollbar_style; |
214 SliderExtraParams slider; | 221 SliderExtraParams slider; |
215 TextFieldExtraParams text_field; | 222 TextFieldExtraParams text_field; |
216 TrackbarExtraParams trackbar; | 223 TrackbarExtraParams trackbar; |
217 }; | 224 }; |
218 | 225 |
219 // Return the size of the part. | 226 // Return the size of the part. |
220 virtual gfx::Size GetPartSize(Part part, | 227 virtual gfx::Size GetPartSize(Part part, |
221 State state, | 228 State state, |
222 const ExtraParams& extra) const = 0; | 229 const ExtraParams& extra) const = 0; |
223 | 230 |
224 // Paint the part to the canvas. | 231 // Paint the part to the canvas. |
225 virtual void Paint(SkCanvas* canvas, | 232 virtual void Paint(SkCanvas* canvas, |
226 Part part, | 233 Part part, |
227 State state, | 234 State state, |
228 const gfx::Rect& rect, | 235 const gfx::Rect& rect, |
229 const ExtraParams& extra) const = 0; | 236 const ExtraParams& extra) const = 0; |
230 | 237 |
231 // Paint part during state transition, used for overlay scrollbar state | 238 // Paint part during state transition, used for overlay scrollbar state |
232 // transition animation. | 239 // transition animation. |
233 virtual void PaintStateTransition(SkCanvas* canvas, | 240 virtual void PaintStateTransition(SkCanvas* canvas, |
234 Part part, | 241 Part part, |
235 State startState, | 242 State startState, |
236 State endState, | 243 State endState, |
237 double progress, | 244 double progress, |
238 const gfx::Rect& rect) const { } | 245 const gfx::Rect& rect, |
| 246 ScrollbarOverlayStyle style) const { } |
239 | 247 |
240 // Supports theme specific colors. | 248 // Supports theme specific colors. |
241 void SetScrollbarColors(unsigned inactive_color, | 249 void SetScrollbarColors(unsigned inactive_color, |
242 unsigned active_color, | 250 unsigned active_color, |
243 unsigned track_color); | 251 unsigned track_color); |
244 | 252 |
245 // Colors for GetSystemColor(). | 253 // Colors for GetSystemColor(). |
246 enum ColorId { | 254 enum ColorId { |
247 // Windows | 255 // Windows |
248 kColorId_WindowBackground, | 256 kColorId_WindowBackground, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 private: | 382 private: |
375 // Observers to notify when the native theme changes. | 383 // Observers to notify when the native theme changes. |
376 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 384 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
377 | 385 |
378 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 386 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
379 }; | 387 }; |
380 | 388 |
381 } // namespace ui | 389 } // namespace ui |
382 | 390 |
383 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 391 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
OLD | NEW |