summaryrefslogtreecommitdiffstats
path: root/app/theme_provider.h
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 20:21:13 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 20:21:13 +0000
commit8fcc39da6cd2a6ea148886e2d8333fc02bd62a21 (patch)
tree09dbcbaa42b748b54c923461a951d10df79327b6 /app/theme_provider.h
parent9f50a2f07eb717f613b7cada7e25bfa6e3c79de2 (diff)
downloadchromium_src-8fcc39da6cd2a6ea148886e2d8333fc02bd62a21.zip
chromium_src-8fcc39da6cd2a6ea148886e2d8333fc02bd62a21.tar.gz
chromium_src-8fcc39da6cd2a6ea148886e2d8333fc02bd62a21.tar.bz2
Add GetPixbufNamed to ThemeProvider. GetPixbufNamed converts a loaded theme bitmap to a GdkPixbuf and caches the image so ThemeProvider users don't need to release them ala ResourceBundle::GetPixbufNamed.
Review URL: http://codereview.chromium.org/113626 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/theme_provider.h')
-rw-r--r--app/theme_provider.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/theme_provider.h b/app/theme_provider.h
index 7257886..29ce2ce 100644
--- a/app/theme_provider.h
+++ b/app/theme_provider.h
@@ -5,8 +5,13 @@
#ifndef APP_THEME_PROVIDER_H_
#define APP_THEME_PROVIDER_H_
+#include "base/basictypes.h"
#include "third_party/skia/include/core/SkColor.h"
+#if defined(OS_LINUX)
+#include <gdk/gdk.h>
+#endif
+
class SkBitmap;
////////////////////////////////////////////////////////////////////////////////
@@ -28,6 +33,18 @@ class ThemeProvider {
// Get the color specified by |id|.
virtual SkColor GetColor(int id) = 0;
+
+#if defined(OS_LINUX)
+ // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared
+ // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme
+ // provider and should not be freed.
+ //
+ // The bitmap is assumed to exist. This function will log in release, and
+ // assert in debug mode if it does not. On failure, this will return a
+ // pointer to a shared empty placeholder bitmap so it will be visible what
+ // is missing.
+ virtual GdkPixbuf* GetPixbufNamed(int id) = 0;
+#endif
};
#endif // APP_THEME_PROVIDER_H_