summaryrefslogtreecommitdiffstats
path: root/chrome/browser/themes/theme_service.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/themes/theme_service.cc')
-rw-r--r--chrome/browser/themes/theme_service.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index e5628e4..f9be837 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -22,6 +22,7 @@
#include "grit/theme_resources_standard.h"
#include "grit/ui_resources.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/image/image_skia.h"
#if defined(OS_WIN) && !defined(USE_AURA)
#include "ui/views/widget/native_widget_win.h"
@@ -244,17 +245,20 @@ const gfx::Image* ThemeService::GetImageNamed(int id) const {
}
SkBitmap* ThemeService::GetBitmapNamed(int id) const {
- DCHECK(CalledOnValidThread());
-
- SkBitmap* bitmap = NULL;
-
- if (theme_pack_.get())
- bitmap = theme_pack_->GetBitmapNamed(id);
+ const gfx::Image* image = GetImageNamed(id);
+ if (!image)
+ return NULL;
- if (!bitmap)
- bitmap = rb_.GetBitmapNamed(id);
+ return const_cast<SkBitmap*>(image->ToSkBitmap());
+}
- return bitmap;
+gfx::ImageSkia* ThemeService::GetImageSkiaNamed(int id) const {
+ const gfx::Image* image = GetImageNamed(id);
+ if (!image)
+ return NULL;
+ // TODO(pkotwicz): Remove this const cast. The gfx::Image interface returns
+ // its images const. GetImageSkiaNamed() also should but has many callsites.
+ return const_cast<gfx::ImageSkia*>(image->ToImageSkia());
}
SkColor ThemeService::GetColor(int id) const {