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

Side by Side Diff: chrome/browser/icon_loader_mac.mm

Issue 10820049: Load 2x resources on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated comment Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/icon_loader_linux.cc ('k') | chrome/browser/icon_loader_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/icon_loader.h" 5 #include "chrome/browser/icon_loader.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 15 matching lines...) Expand all
26 switch (icon_size_) { 26 switch (icon_size_) {
27 case IconLoader::SMALL: 27 case IconLoader::SMALL:
28 size = NSMakeSize(16, 16); 28 size = NSMakeSize(16, 16);
29 break; 29 break;
30 case IconLoader::NORMAL: 30 case IconLoader::NORMAL:
31 size = NSMakeSize(32, 32); 31 size = NSMakeSize(32, 32);
32 break; 32 break;
33 default: 33 default:
34 NOTREACHED(); 34 NOTREACHED();
35 } 35 }
36 image_.reset(new gfx::Image(gfx::ImageSkiaFromResizedNSImage(icon, size))); 36 gfx::ImageSkia image_skia(gfx::ImageSkiaFromResizedNSImage(icon, size));
37 image_skia.MakeThreadSafe();
38 image_.reset(new gfx::Image(image_skia));
37 } 39 }
38 40
39 target_message_loop_->PostTask(FROM_HERE, 41 target_message_loop_->PostTask(FROM_HERE,
40 base::Bind(&IconLoader::NotifyDelegate, this)); 42 base::Bind(&IconLoader::NotifyDelegate, this));
41 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader_linux.cc ('k') | chrome/browser/icon_loader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698