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 "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/size.h" |
12 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/native_theme/native_theme_export.h" | 15 #include "ui/native_theme/native_theme_export.h" |
14 | 16 |
15 class SkCanvas; | 17 class SkCanvas; |
16 | 18 |
17 namespace gfx { | |
18 class Rect; | |
19 class Size; | |
20 } | |
21 | |
22 namespace ui { | 19 namespace ui { |
23 | 20 |
24 class NativeThemeObserver; | 21 class NativeThemeObserver; |
25 | 22 |
26 // This class supports drawing UI controls (like buttons, text fields, lists, | 23 // This class supports drawing UI controls (like buttons, text fields, lists, |
27 // comboboxes, etc) that look like the native UI controls of the underlying | 24 // comboboxes, etc) that look like the native UI controls of the underlying |
28 // platform, such as Windows or Linux. It also supplies default colors for | 25 // platform, such as Windows or Linux. It also supplies default colors for |
29 // dialog box backgrounds, etc., which are obtained from the system theme where | 26 // dialog box backgrounds, etc., which are obtained from the system theme where |
30 // possible. | 27 // possible. |
31 // | 28 // |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 State state, | 224 State state, |
228 const ExtraParams& extra) const = 0; | 225 const ExtraParams& extra) const = 0; |
229 | 226 |
230 // Paint the part to the canvas. | 227 // Paint the part to the canvas. |
231 virtual void Paint(SkCanvas* canvas, | 228 virtual void Paint(SkCanvas* canvas, |
232 Part part, | 229 Part part, |
233 State state, | 230 State state, |
234 const gfx::Rect& rect, | 231 const gfx::Rect& rect, |
235 const ExtraParams& extra) const = 0; | 232 const ExtraParams& extra) const = 0; |
236 | 233 |
237 // Paint part during state transition, used for overlay scrollbar state | 234 virtual bool SupportsNinePatch(Part part) const = 0; |
238 // transition animation. | 235 virtual gfx::Size GetNinePatchCanvasSize(Part part) const = 0; |
239 virtual void PaintStateTransition(SkCanvas* canvas, | 236 virtual gfx::Rect GetNinePatchAperture(Part part) const = 0; |
240 Part part, | |
241 State startState, | |
242 State endState, | |
243 double progress, | |
244 const gfx::Rect& rect, | |
245 ScrollbarOverlayColorTheme theme) const {} | |
246 | 237 |
247 // Supports theme specific colors. | 238 // Supports theme specific colors. |
248 void SetScrollbarColors(unsigned inactive_color, | 239 void SetScrollbarColors(unsigned inactive_color, |
249 unsigned active_color, | 240 unsigned active_color, |
250 unsigned track_color); | 241 unsigned track_color); |
251 | 242 |
252 // Colors for GetSystemColor(). | 243 // Colors for GetSystemColor(). |
253 enum ColorId { | 244 enum ColorId { |
254 // Windows | 245 // Windows |
255 kColorId_WindowBackground, | 246 kColorId_WindowBackground, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 private: | 378 private: |
388 // Observers to notify when the native theme changes. | 379 // Observers to notify when the native theme changes. |
389 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 380 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
390 | 381 |
391 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 382 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
392 }; | 383 }; |
393 | 384 |
394 } // namespace ui | 385 } // namespace ui |
395 | 386 |
396 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 387 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
OLD | NEW |