| 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 "skia/ext/cdl_common.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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 TextFieldExtraParams text_field; | 220 TextFieldExtraParams text_field; |
| 222 TrackbarExtraParams trackbar; | 221 TrackbarExtraParams trackbar; |
| 223 }; | 222 }; |
| 224 | 223 |
| 225 // Return the size of the part. | 224 // Return the size of the part. |
| 226 virtual gfx::Size GetPartSize(Part part, | 225 virtual gfx::Size GetPartSize(Part part, |
| 227 State state, | 226 State state, |
| 228 const ExtraParams& extra) const = 0; | 227 const ExtraParams& extra) const = 0; |
| 229 | 228 |
| 230 // Paint the part to the canvas. | 229 // Paint the part to the canvas. |
| 231 virtual void Paint(SkCanvas* canvas, | 230 virtual void Paint(CdlCanvas* canvas, |
| 232 Part part, | 231 Part part, |
| 233 State state, | 232 State state, |
| 234 const gfx::Rect& rect, | 233 const gfx::Rect& rect, |
| 235 const ExtraParams& extra) const = 0; | 234 const ExtraParams& extra) const = 0; |
| 236 | 235 |
| 237 // Paint part during state transition, used for overlay scrollbar state | 236 // Paint part during state transition, used for overlay scrollbar state |
| 238 // transition animation. | 237 // transition animation. |
| 239 virtual void PaintStateTransition(SkCanvas* canvas, | 238 virtual void PaintStateTransition(CdlCanvas* canvas, |
| 240 Part part, | 239 Part part, |
| 241 State startState, | 240 State startState, |
| 242 State endState, | 241 State endState, |
| 243 double progress, | 242 double progress, |
| 244 const gfx::Rect& rect, | 243 const gfx::Rect& rect, |
| 245 ScrollbarOverlayColorTheme theme) const {} | 244 ScrollbarOverlayColorTheme theme) const {} |
| 246 | 245 |
| 247 // Supports theme specific colors. | 246 // Supports theme specific colors. |
| 248 void SetScrollbarColors(unsigned inactive_color, | 247 void SetScrollbarColors(unsigned inactive_color, |
| 249 unsigned active_color, | 248 unsigned active_color, |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 private: | 385 private: |
| 387 // Observers to notify when the native theme changes. | 386 // Observers to notify when the native theme changes. |
| 388 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 387 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
| 389 | 388 |
| 390 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 389 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
| 391 }; | 390 }; |
| 392 | 391 |
| 393 } // namespace ui | 392 } // namespace ui |
| 394 | 393 |
| 395 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 394 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
| OLD | NEW |