| 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/base/models/menu_separator_types.h" | 13 #include "ui/base/models/menu_separator_types.h" |
| 13 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 14 #include "ui/native_theme/native_theme_export.h" | 15 #include "ui/native_theme/native_theme_export.h" |
| 15 | 16 |
| 16 class SkCanvas; | |
| 17 | |
| 18 namespace gfx { | 17 namespace gfx { |
| 19 class Rect; | 18 class Rect; |
| 20 class Size; | 19 class Size; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace ui { | 22 namespace ui { |
| 24 | 23 |
| 25 class NativeThemeObserver; | 24 class NativeThemeObserver; |
| 26 | 25 |
| 27 // This class supports drawing UI controls (like buttons, text fields, lists, | 26 // This class supports drawing UI controls (like buttons, text fields, lists, |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 TextFieldExtraParams text_field; | 244 TextFieldExtraParams text_field; |
| 246 TrackbarExtraParams trackbar; | 245 TrackbarExtraParams trackbar; |
| 247 }; | 246 }; |
| 248 | 247 |
| 249 // Return the size of the part. | 248 // Return the size of the part. |
| 250 virtual gfx::Size GetPartSize(Part part, | 249 virtual gfx::Size GetPartSize(Part part, |
| 251 State state, | 250 State state, |
| 252 const ExtraParams& extra) const = 0; | 251 const ExtraParams& extra) const = 0; |
| 253 | 252 |
| 254 // Paint the part to the canvas. | 253 // Paint the part to the canvas. |
| 255 virtual void Paint(SkCanvas* canvas, | 254 virtual void Paint(cc::PaintCanvas* canvas, |
| 256 Part part, | 255 Part part, |
| 257 State state, | 256 State state, |
| 258 const gfx::Rect& rect, | 257 const gfx::Rect& rect, |
| 259 const ExtraParams& extra) const = 0; | 258 const ExtraParams& extra) const = 0; |
| 260 | 259 |
| 261 // Paint part during state transition, used for overlay scrollbar state | 260 // Paint part during state transition, used for overlay scrollbar state |
| 262 // transition animation. | 261 // transition animation. |
| 263 virtual void PaintStateTransition(SkCanvas* canvas, | 262 virtual void PaintStateTransition(cc::PaintCanvas* canvas, |
| 264 Part part, | 263 Part part, |
| 265 State startState, | 264 State startState, |
| 266 State endState, | 265 State endState, |
| 267 double progress, | 266 double progress, |
| 268 const gfx::Rect& rect, | 267 const gfx::Rect& rect, |
| 269 ScrollbarOverlayColorTheme theme) const {} | 268 ScrollbarOverlayColorTheme theme) const {} |
| 270 | 269 |
| 271 // Supports theme specific colors. | 270 // Supports theme specific colors. |
| 272 void SetScrollbarColors(unsigned inactive_color, | 271 void SetScrollbarColors(unsigned inactive_color, |
| 273 unsigned active_color, | 272 unsigned active_color, |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 private: | 416 private: |
| 418 // Observers to notify when the native theme changes. | 417 // Observers to notify when the native theme changes. |
| 419 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 418 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
| 420 | 419 |
| 421 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 420 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
| 422 }; | 421 }; |
| 423 | 422 |
| 424 } // namespace ui | 423 } // namespace ui |
| 425 | 424 |
| 426 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 425 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
| OLD | NEW |