Chromium Code Reviews| 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..631973546f1b499affe8ffdba5900f4d495c0904 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,18 @@ 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); |
|
sky
2012/05/10 17:08:24
Add TODOs about removing casts.
|
| + 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; |
| + return const_cast<gfx::ImageSkia*>(image->ToImageSkia()); |
| } |
| SkColor ThemeService::GetColor(int id) const { |