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

Unified Diff: chrome/browser/icon_loader_mac.mm

Issue 6995068: Mac: Fix icons in download dom UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux build Created 9 years, 6 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/icon_loader_linux.cc ('k') | chrome/browser/ui/cocoa/download/download_item_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader_mac.mm
diff --git a/chrome/browser/icon_loader_mac.mm b/chrome/browser/icon_loader_mac.mm
index 9b26ff38a22bdab5b138dce8064a3cc8d7690fd6..8502a7d40157056d609d8c85d4b123c059e9df14 100644
--- a/chrome/browser/icon_loader_mac.mm
+++ b/chrome/browser/icon_loader_mac.mm
@@ -17,9 +17,24 @@ void IconLoader::ReadIcon() {
NSWorkspace* workspace = [NSWorkspace sharedWorkspace];
NSImage* icon = [workspace iconForFileType:group];
- // Mac will ignore the size because icons have multiple size representations
- // and NSImage choses the best at draw-time.
- image_.reset(new gfx::Image([icon retain]));
+ if (icon_size_ == ALL) {
+ // The NSImage already has all sizes.
+ image_.reset(new gfx::Image([icon retain]));
+ } else {
+ NSSize size = NSZeroSize;
+ switch (icon_size_) {
+ case IconLoader::SMALL:
+ size = NSMakeSize(16, 16);
+ break;
+ case IconLoader::NORMAL:
+ size = NSMakeSize(32, 32);
+ break;
+ default:
+ NOTREACHED();
+ }
+ image_.reset(new gfx::Image(new SkBitmap(
+ gfx::NSImageToSkBitmap(icon, size, false))));
+ }
target_message_loop_->PostTask(FROM_HERE,
NewRunnableMethod(this, &IconLoader::NotifyDelegate));
« no previous file with comments | « chrome/browser/icon_loader_linux.cc ('k') | chrome/browser/ui/cocoa/download/download_item_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698