Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: chrome/browser/themes/theme_service.cc

Issue 13497002: Crop images from custom themes before storing them into the theme pack (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/themes/theme_service.cc
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index d540b602e28957c9502a7d4948f9f34e8bb70827..512855d0017658a996d147de41bd0463df2e22d6 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -108,21 +108,20 @@ void ThemeService::Init(Profile* profile) {
gfx::Image ThemeService::GetImageNamed(int id) const {
DCHECK(CalledOnValidThread());
- const gfx::Image* image = NULL;
-
+ gfx::Image image;
if (theme_pack_.get())
image = theme_pack_->GetImageNamed(id);
#if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
const ui::LinuxUI* linux_ui = ui::LinuxUI::instance();
- if (!image && linux_ui)
+ if (image.IsEmpty() && linux_ui)
image = linux_ui->GetThemeImageNamed(id);
#endif
- if (!image)
- image = &rb_.GetNativeImageNamed(id);
+ if (image.IsEmpty())
+ image = rb_.GetNativeImageNamed(id);
- return image ? *image : gfx::Image();
+ return image;
}
gfx::ImageSkia* ThemeService::GetImageSkiaNamed(int id) const {

Powered by Google App Engine
This is Rietveld 408576698