 Chromium Code Reviews
 Chromium Code Reviews Issue 6849030:
  Add support for multi resolution icons   (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 6849030:
  Add support for multi resolution icons   (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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..41cb6b56e4583811c8f64e667c1bbab2e05a838b 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 = static_cast<NSImage*>(rb_.GetNativeImageNamed(id)); | 
| 
Robert Sesek
2011/04/15 20:27:20
You can probably get away without the static cast
 
sail
2011/04/16 01:25:00
Done.
 
sail
2011/04/16 01:25:00
Done.
 | 
| + } | 
| // We loaded successfully. Cache the image. | 
| if (nsimage) { |