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 "base/basictypes.h" | 8 #include "base/basictypes.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/ui_export.h" | 11 #include "ui/base/ui_export.h" |
11 | 12 |
12 #if defined(OS_MACOSX) | 13 #if defined(OS_MACOSX) |
13 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
14 @class NSColor; | 15 @class NSColor; |
15 @class NSGradient; | 16 @class NSGradient; |
16 @class NSImage; | 17 @class NSImage; |
17 #else | 18 #else |
18 class NSColor; | 19 class NSColor; |
19 class NSGradient; | 20 class NSGradient; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // a custom frame. | 71 // a custom frame. |
71 virtual bool ShouldUseNativeFrame() const = 0; | 72 virtual bool ShouldUseNativeFrame() const = 0; |
72 | 73 |
73 // Whether or not we have a certain image. Used for when the default theme | 74 // Whether or not we have a certain image. Used for when the default theme |
74 // doesn't provide a certain image, but custom themes might (badges, etc). | 75 // doesn't provide a certain image, but custom themes might (badges, etc). |
75 virtual bool HasCustomImage(int id) const = 0; | 76 virtual bool HasCustomImage(int id) const = 0; |
76 | 77 |
77 // Reads the image data from the theme file into the specified vector. Only | 78 // Reads the image data from the theme file into the specified vector. Only |
78 // valid for un-themed resources and the themed IDR_THEME_NTP_* in most | 79 // valid for un-themed resources and the themed IDR_THEME_NTP_* in most |
79 // implementations of ThemeProvider. Returns NULL on error. | 80 // implementations of ThemeProvider. Returns NULL on error. |
80 virtual base::RefCountedMemory* GetRawData(int id) const = 0; | 81 virtual base::RefCountedMemory* GetRawData( |
| 82 int id, |
| 83 ui::ScaleFactor scale_factor) const = 0; |
81 | 84 |
82 #if defined(OS_MACOSX) && !defined(TOOLKIT_VIEWS) | 85 #if defined(OS_MACOSX) && !defined(TOOLKIT_VIEWS) |
83 // Gets the NSImage with the specified |id|. | 86 // Gets the NSImage with the specified |id|. |
84 // | 87 // |
85 // The bitmap is not assumed to exist. If a theme does not provide an image, | 88 // The bitmap is not assumed to exist. If a theme does not provide an image, |
86 // if |allow_default| is true, then the default image will be returned, else | 89 // if |allow_default| is true, then the default image will be returned, else |
87 // this function will return nil. | 90 // this function will return nil. |
88 virtual NSImage* GetNSImageNamed(int id, bool allow_default) const = 0; | 91 virtual NSImage* GetNSImageNamed(int id, bool allow_default) const = 0; |
89 | 92 |
90 // Gets the NSImage that GetNSImageNamed (above) would return, but returns it | 93 // Gets the NSImage that GetNSImageNamed (above) would return, but returns it |
(...skipping 27 matching lines...) Expand all Loading... |
118 // is missing. | 121 // is missing. |
119 | 122 |
120 // As above, but flips it in RTL locales. | 123 // As above, but flips it in RTL locales. |
121 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; | 124 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; |
122 #endif | 125 #endif |
123 }; | 126 }; |
124 | 127 |
125 } // namespace ui | 128 } // namespace ui |
126 | 129 |
127 #endif // UI_BASE_THEME_PROVIDER_H_ | 130 #endif // UI_BASE_THEME_PROVIDER_H_ |
OLD | NEW |