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 "cc/paint/paint_canvas.h" |
12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
13 #include "ui/base/models/menu_separator_types.h" | 13 #include "ui/base/models/menu_separator_types.h" |
| 14 #include "ui/gfx/geometry/rect.h" |
| 15 #include "ui/gfx/geometry/size.h" |
14 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
15 #include "ui/native_theme/native_theme_export.h" | 17 #include "ui/native_theme/native_theme_export.h" |
16 | 18 |
17 namespace gfx { | 19 namespace gfx { |
18 class Rect; | 20 class Rect; |
19 class Size; | 21 class Size; |
20 } | 22 } |
21 | 23 |
22 namespace ui { | 24 namespace ui { |
23 | 25 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // Paint part during state transition, used for overlay scrollbar state | 262 // Paint part during state transition, used for overlay scrollbar state |
261 // transition animation. | 263 // transition animation. |
262 virtual void PaintStateTransition(cc::PaintCanvas* canvas, | 264 virtual void PaintStateTransition(cc::PaintCanvas* canvas, |
263 Part part, | 265 Part part, |
264 State startState, | 266 State startState, |
265 State endState, | 267 State endState, |
266 double progress, | 268 double progress, |
267 const gfx::Rect& rect, | 269 const gfx::Rect& rect, |
268 ScrollbarOverlayColorTheme theme) const {} | 270 ScrollbarOverlayColorTheme theme) const {} |
269 | 271 |
| 272 // Returns whether the theme uses a nine-patch resource for the given part. |
| 273 // If true, calling code should always paint into a canvas the size of which |
| 274 // can be gotten from GetNinePatchCanvasSize. |
| 275 virtual bool SupportsNinePatch(Part part) const = 0; |
| 276 |
| 277 // If the part paints into a nine-patch resource, the size of the canvas |
| 278 // which should be painted into. |
| 279 virtual gfx::Size GetNinePatchCanvasSize(Part part) const = 0; |
| 280 |
| 281 // If the part paints into a nine-patch resource, the rect in the canvas |
| 282 // which defines the center tile. This is the tile that should be resized out |
| 283 // when the part is resized. |
| 284 virtual gfx::Rect GetNinePatchAperture(Part part) const = 0; |
| 285 |
270 // Supports theme specific colors. | 286 // Supports theme specific colors. |
271 void SetScrollbarColors(unsigned inactive_color, | 287 void SetScrollbarColors(unsigned inactive_color, |
272 unsigned active_color, | 288 unsigned active_color, |
273 unsigned track_color); | 289 unsigned track_color); |
274 | 290 |
275 // Colors for GetSystemColor(). | 291 // Colors for GetSystemColor(). |
276 enum ColorId { | 292 enum ColorId { |
277 // Windows | 293 // Windows |
278 kColorId_WindowBackground, | 294 kColorId_WindowBackground, |
279 // Dialogs | 295 // Dialogs |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 private: | 431 private: |
416 // Observers to notify when the native theme changes. | 432 // Observers to notify when the native theme changes. |
417 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 433 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
418 | 434 |
419 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 435 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
420 }; | 436 }; |
421 | 437 |
422 } // namespace ui | 438 } // namespace ui |
423 | 439 |
424 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 440 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
OLD | NEW |