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_BASE_THEME_PROVIDER_H_ | 5 #ifndef UI_BASE_THEME_PROVIDER_H_ |
6 #define UI_BASE_THEME_PROVIDER_H_ | 6 #define UI_BASE_THEME_PROVIDER_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
10 #include "ui/base/layout.h" | 10 #include "ui/base/layout.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class NSImage; | 21 class NSImage; |
22 #endif // __OBJC__ | 22 #endif // __OBJC__ |
23 #endif // OS_* | 23 #endif // OS_* |
24 | 24 |
25 class SkBitmap; | 25 class SkBitmap; |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class RefCountedMemory; | 28 class RefCountedMemory; |
29 } | 29 } |
30 | 30 |
| 31 namespace color_utils { |
| 32 struct HSL; |
| 33 } |
| 34 |
31 namespace gfx { | 35 namespace gfx { |
32 class ImageSkia; | 36 class ImageSkia; |
33 } | 37 } |
34 | 38 |
35 namespace ui { | 39 namespace ui { |
36 | 40 |
37 //////////////////////////////////////////////////////////////////////////////// | 41 //////////////////////////////////////////////////////////////////////////////// |
38 // | 42 // |
39 // ThemeProvider | 43 // ThemeProvider |
40 // | 44 // |
41 // ThemeProvider is an abstract class that defines the API that should be | 45 // ThemeProvider is an abstract class that defines the API that should be |
42 // implemented to provide bitmaps and color information for a given theme. | 46 // implemented to provide bitmaps and color information for a given theme. |
43 // | 47 // |
44 //////////////////////////////////////////////////////////////////////////////// | 48 //////////////////////////////////////////////////////////////////////////////// |
45 | 49 |
46 class UI_BASE_EXPORT ThemeProvider { | 50 class UI_BASE_EXPORT ThemeProvider { |
47 public: | 51 public: |
48 virtual ~ThemeProvider(); | 52 virtual ~ThemeProvider(); |
49 | 53 |
50 // Get the image specified by |id|. An implementation of ThemeProvider should | 54 // Get the image specified by |id|. An implementation of ThemeProvider should |
51 // have its own source of ids (e.g. an enum, or external resource bundle). | 55 // have its own source of ids (e.g. an enum, or external resource bundle). |
52 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const = 0; | 56 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const = 0; |
53 | 57 |
54 // Get the color specified by |id|. | 58 // Get the color specified by |id|. |
55 virtual SkColor GetColor(int id) const = 0; | 59 virtual SkColor GetColor(int id) const = 0; |
56 | 60 |
| 61 // Get the HSL shift specified by |id|. |
| 62 virtual color_utils::HSL GetTint(int id) const = 0; |
| 63 |
57 // Get the property (e.g. an alignment expressed in an enum, or a width or | 64 // Get the property (e.g. an alignment expressed in an enum, or a width or |
58 // height) specified by |id|. | 65 // height) specified by |id|. |
59 virtual int GetDisplayProperty(int id) const = 0; | 66 virtual int GetDisplayProperty(int id) const = 0; |
60 | 67 |
61 // Whether we should use the native system frame (typically Aero glass) or | 68 // Whether we should use the native system frame (typically Aero glass) or |
62 // a custom frame. | 69 // a custom frame. |
63 virtual bool ShouldUseNativeFrame() const = 0; | 70 virtual bool ShouldUseNativeFrame() const = 0; |
64 | 71 |
65 // Whether or not we have a certain image. Used for when the default theme | 72 // Whether or not we have a certain image. Used for when the default theme |
66 // doesn't provide a certain image, but custom themes might (badges, etc). | 73 // doesn't provide a certain image, but custom themes might (badges, etc). |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 virtual NSGradient* GetNSGradient(int id) const = 0; | 110 virtual NSGradient* GetNSGradient(int id) const = 0; |
104 | 111 |
105 // Whether the "increase contrast" accessibility setting is enabled. | 112 // Whether the "increase contrast" accessibility setting is enabled. |
106 virtual bool ShouldIncreaseContrast() const = 0; | 113 virtual bool ShouldIncreaseContrast() const = 0; |
107 #endif | 114 #endif |
108 }; | 115 }; |
109 | 116 |
110 } // namespace ui | 117 } // namespace ui |
111 | 118 |
112 #endif // UI_BASE_THEME_PROVIDER_H_ | 119 #endif // UI_BASE_THEME_PROVIDER_H_ |
OLD | NEW |