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

Unified Diff: chrome/browser/themes/theme_service_mac.mm

Issue 6849030: Add support for multi resolution icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments Created 9 years, 8 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
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/ui/cocoa/background_gradient_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_service_mac.mm
diff --git a/chrome/browser/themes/theme_service_mac.mm b/chrome/browser/themes/theme_service_mac.mm
index 30d359ee203040d8f36aca70ad7887d964e97253..c355e0d4155ac572b6c5a4a3c9d84d03234d010d 100644
--- a/chrome/browser/themes/theme_service_mac.mm
+++ b/chrome/browser/themes/theme_service_mac.mm
@@ -10,7 +10,9 @@
#include "chrome/browser/themes/browser_theme_pack.h"
#include "skia/ext/skia_utils_mac.h"
#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_utils.h"
+#include "ui/gfx/image.h"
NSString* const kBrowserThemeDidChangeNotification =
@"BrowserThemeDidChangeNotification";
@@ -44,8 +46,16 @@ NSImage* ThemeService::GetNSImageNamed(int id, bool allow_default) const {
// SkBitmap > native conversion?
// - For consistency with other platforms.
// - To get the generated tinted images.
- SkBitmap* bitmap = GetBitmapNamed(id);
- NSImage* nsimage = gfx::SkBitmapToNSImage(*bitmap);
+ NSImage* nsimage = nil;
+ if (theme_pack_.get()) {
+ SkBitmap* bitmap = theme_pack_->GetBitmapNamed(id);
+ if (bitmap)
+ nsimage = gfx::SkBitmapToNSImage(*bitmap);
+ }
+
+ if (!nsimage) {
+ nsimage = rb_.GetNativeImageNamed(id);
+ }
// We loaded successfully. Cache the image.
if (nsimage) {
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/ui/cocoa/background_gradient_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698