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

Side by Side Diff: chrome/browser/icon_loader_win.cc

Issue 8523008: base::Bind() chrome/browser/icon_loader*.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 1 month 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_mac.mm ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include "base/bind.h"
10 #include "base/message_loop.h" 11 #include "base/message_loop.h"
11 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
12 #include "ui/gfx/icon_util.h" 13 #include "ui/gfx/icon_util.h"
13 #include "ui/gfx/size.h" 14 #include "ui/gfx/size.h"
14 15
15 void IconLoader::ReadIcon() { 16 void IconLoader::ReadIcon() {
16 int size = 0; 17 int size = 0;
17 switch (icon_size_) { 18 switch (icon_size_) {
18 case IconLoader::SMALL: 19 case IconLoader::SMALL:
19 size = SHGFI_SMALLICON; 20 size = SHGFI_SMALLICON;
(...skipping 10 matching lines...) Expand all
30 SHFILEINFO file_info = { 0 }; 31 SHFILEINFO file_info = { 0 };
31 if (!SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info, 32 if (!SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info,
32 sizeof(SHFILEINFO), 33 sizeof(SHFILEINFO),
33 SHGFI_ICON | size | SHGFI_USEFILEATTRIBUTES)) 34 SHGFI_ICON | size | SHGFI_USEFILEATTRIBUTES))
34 return; 35 return;
35 36
36 image_.reset(new gfx::Image( 37 image_.reset(new gfx::Image(
37 IconUtil::CreateSkBitmapFromHICON(file_info.hIcon))); 38 IconUtil::CreateSkBitmapFromHICON(file_info.hIcon)));
38 DestroyIcon(file_info.hIcon); 39 DestroyIcon(file_info.hIcon);
39 target_message_loop_->PostTask(FROM_HERE, 40 target_message_loop_->PostTask(FROM_HERE,
40 NewRunnableMethod(this, &IconLoader::NotifyDelegate)); 41 base::Bind(&IconLoader::NotifyDelegate, this));
41 } 42 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698