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

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

Issue 10378009: Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 8 years, 7 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
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/bind.h"
(...skipping 16 matching lines...) Expand all
27 break; 27 break;
28 default: 28 default:
29 NOTREACHED(); 29 NOTREACHED();
30 } 30 }
31 SHFILEINFO file_info = { 0 }; 31 SHFILEINFO file_info = { 0 };
32 if (!SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info, 32 if (!SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info,
33 sizeof(SHFILEINFO), 33 sizeof(SHFILEINFO),
34 SHGFI_ICON | size | SHGFI_USEFILEATTRIBUTES)) 34 SHGFI_ICON | size | SHGFI_USEFILEATTRIBUTES))
35 return; 35 return;
36 36
37 image_.reset(new gfx::Image( 37 scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(
38 IconUtil::CreateSkBitmapFromHICON(file_info.hIcon))); 38 file_info.hIcon));
39 image_.reset(new gfx::Image(*bitmap));
39 DestroyIcon(file_info.hIcon); 40 DestroyIcon(file_info.hIcon);
40 target_message_loop_->PostTask(FROM_HERE, 41 target_message_loop_->PostTask(FROM_HERE,
41 base::Bind(&IconLoader::NotifyDelegate, this)); 42 base::Bind(&IconLoader::NotifyDelegate, this));
42 } 43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698