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 "cc/paint/paint_canvas.h" |
11 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.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 | |
17 namespace gfx { | 16 namespace gfx { |
18 class Rect; | 17 class Rect; |
19 class Size; | 18 class Size; |
20 } | 19 } |
21 | 20 |
22 namespace ui { | 21 namespace ui { |
23 | 22 |
24 class NativeThemeObserver; | 23 class NativeThemeObserver; |
25 | 24 |
26 // This class supports drawing UI controls (like buttons, text fields, lists, | 25 // This class supports drawing UI controls (like buttons, text fields, lists, |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 TextFieldExtraParams text_field; | 237 TextFieldExtraParams text_field; |
239 TrackbarExtraParams trackbar; | 238 TrackbarExtraParams trackbar; |
240 }; | 239 }; |
241 | 240 |
242 // Return the size of the part. | 241 // Return the size of the part. |
243 virtual gfx::Size GetPartSize(Part part, | 242 virtual gfx::Size GetPartSize(Part part, |
244 State state, | 243 State state, |
245 const ExtraParams& extra) const = 0; | 244 const ExtraParams& extra) const = 0; |
246 | 245 |
247 // Paint the part to the canvas. | 246 // Paint the part to the canvas. |
248 virtual void Paint(SkCanvas* canvas, | 247 virtual void Paint(cc::PaintCanvas* canvas, |
249 Part part, | 248 Part part, |
250 State state, | 249 State state, |
251 const gfx::Rect& rect, | 250 const gfx::Rect& rect, |
252 const ExtraParams& extra) const = 0; | 251 const ExtraParams& extra) const = 0; |
253 | 252 |
254 // Paint part during state transition, used for overlay scrollbar state | 253 // Paint part during state transition, used for overlay scrollbar state |
255 // transition animation. | 254 // transition animation. |
256 virtual void PaintStateTransition(SkCanvas* canvas, | 255 virtual void PaintStateTransition(cc::PaintCanvas* canvas, |
257 Part part, | 256 Part part, |
258 State startState, | 257 State startState, |
259 State endState, | 258 State endState, |
260 double progress, | 259 double progress, |
261 const gfx::Rect& rect, | 260 const gfx::Rect& rect, |
262 ScrollbarOverlayColorTheme theme) const {} | 261 ScrollbarOverlayColorTheme theme) const {} |
263 | 262 |
264 // Supports theme specific colors. | 263 // Supports theme specific colors. |
265 void SetScrollbarColors(unsigned inactive_color, | 264 void SetScrollbarColors(unsigned inactive_color, |
266 unsigned active_color, | 265 unsigned active_color, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 private: | 409 private: |
411 // Observers to notify when the native theme changes. | 410 // Observers to notify when the native theme changes. |
412 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 411 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
413 | 412 |
414 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 413 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
415 }; | 414 }; |
416 | 415 |
417 } // namespace ui | 416 } // namespace ui |
418 | 417 |
419 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 418 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
OLD | NEW |