| Index: chrome/browser/themes/theme_service.cc
|
| diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
|
| index e5628e46e0a892655266c8c88b47e428f6ded32f..f9be8372dce9bf43da54262eb1336f4dbb2ca287 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 {
|
|
|