| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 APP_THEME_PROVIDER_H_ | 5 #ifndef APP_THEME_PROVIDER_H_ |
| 6 #define APP_THEME_PROVIDER_H_ | 6 #define APP_THEME_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Reads the image data from the theme file into the specified vector. Only | 65 // Reads the image data from the theme file into the specified vector. Only |
| 66 // valid for un-themed resources and the themed IDR_THEME_NTP_* in most | 66 // valid for un-themed resources and the themed IDR_THEME_NTP_* in most |
| 67 // implementations of ThemeProvider. Returns NULL on error. | 67 // implementations of ThemeProvider. Returns NULL on error. |
| 68 virtual RefCountedMemory* GetRawData(int id) const = 0; | 68 virtual RefCountedMemory* GetRawData(int id) const = 0; |
| 69 | 69 |
| 70 #if defined(OS_MACOSX) | 70 #if defined(OS_MACOSX) |
| 71 // Gets the NSImage with the specified |id|. | 71 // Gets the NSImage with the specified |id|. |
| 72 // | 72 // |
| 73 // The bitmap is not assumed to exist. If a theme does not provide an image, | 73 // The bitmap is not assumed to exist. If a theme does not provide an image, |
| 74 // if |allow_default| is true, then the default image will be returned, else |
| 74 // this function will return nil. | 75 // this function will return nil. |
| 75 virtual NSImage* GetNSImageNamed(int id) const = 0; | 76 virtual NSImage* GetNSImageNamed(int id, bool allow_default) const = 0; |
| 76 | 77 |
| 77 // Gets the NSColor with the specified |id|. | 78 // Gets the NSColor with the specified |id|. |
| 78 // | 79 // |
| 79 // The color is not assumed to exist. If a theme does not provide an color, | 80 // The color is not assumed to exist. If a theme does not provide an color, if |
| 80 // this function will return nil. | 81 // |allow_default| is true, then the default color will be returned, else this |
| 81 virtual NSColor* GetNSColor(int id) const = 0; | 82 // function will return nil. |
| 83 virtual NSColor* GetNSColor(int id, bool allow_default) const = 0; |
| 82 | 84 |
| 83 // Gets the NSColor for tinting with the specified |id|. | 85 // Gets the NSColor for tinting with the specified |id|. |
| 84 // | 86 // |
| 85 // The tint is not assumed to exist. If a theme does not provide a tint with | 87 // The tint is not assumed to exist. If a theme does not provide a tint with |
| 86 // that id, this function will return nil. | 88 // that id, if |allow_default| is true, then the default tint will be |
| 87 virtual NSColor* GetNSColorTint(int id) const = 0; | 89 // returned, else this function will return nil. |
| 90 virtual NSColor* GetNSColorTint(int id, bool allow_default) const = 0; |
| 88 #elif defined(OS_POSIX) && !defined(TOOLKIT_VIEWS) | 91 #elif defined(OS_POSIX) && !defined(TOOLKIT_VIEWS) |
| 89 // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared | 92 // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared |
| 90 // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme | 93 // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme |
| 91 // provider and should not be freed. | 94 // provider and should not be freed. |
| 92 // | 95 // |
| 93 // The bitmap is assumed to exist. This function will log in release, and | 96 // The bitmap is assumed to exist. This function will log in release, and |
| 94 // assert in debug mode if it does not. On failure, this will return a | 97 // assert in debug mode if it does not. On failure, this will return a |
| 95 // pointer to a shared empty placeholder bitmap so it will be visible what | 98 // pointer to a shared empty placeholder bitmap so it will be visible what |
| 96 // is missing. | 99 // is missing. |
| 97 virtual GdkPixbuf* GetPixbufNamed(int id) const = 0; | 100 virtual GdkPixbuf* GetPixbufNamed(int id) const = 0; |
| 98 | 101 |
| 99 // As above, but flips it in RTL locales. | 102 // As above, but flips it in RTL locales. |
| 100 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; | 103 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; |
| 101 #endif | 104 #endif |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 #endif // APP_THEME_PROVIDER_H_ | 107 #endif // APP_THEME_PROVIDER_H_ |
| OLD | NEW |