| Index: chrome/browser/icon_loader_win.cc
|
| diff --git a/chrome/browser/icon_loader_win.cc b/chrome/browser/icon_loader_win.cc
|
| index 48e565f840d6a663c21d5542c85a991500ad2c7c..8a167acbae3e057ecb1ca02e6403788e7c80e2f5 100644
|
| --- a/chrome/browser/icon_loader_win.cc
|
| +++ b/chrome/browser/icon_loader_win.cc
|
| @@ -30,18 +30,24 @@ void IconLoader::ReadIcon() {
|
| default:
|
| NOTREACHED();
|
| }
|
| +
|
| + image_.reset();
|
| +
|
| SHFILEINFO file_info = { 0 };
|
| - if (!SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info,
|
| + if (SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info,
|
| sizeof(SHFILEINFO),
|
| - SHGFI_ICON | size | SHGFI_USEFILEATTRIBUTES))
|
| - return;
|
| + SHGFI_ICON | size | SHGFI_USEFILEATTRIBUTES)) {
|
| + scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(
|
| + file_info.hIcon));
|
| + if (bitmap.get()) {
|
| + gfx::ImageSkia image_skia(*bitmap);
|
| + image_skia.MakeThreadSafe();
|
| + image_.reset(new gfx::Image(image_skia));
|
| + DestroyIcon(file_info.hIcon);
|
| + }
|
| + }
|
|
|
| - scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(
|
| - file_info.hIcon));
|
| - gfx::ImageSkia image_skia(*bitmap);
|
| - image_skia.MakeThreadSafe();
|
| - image_.reset(new gfx::Image(image_skia));
|
| - DestroyIcon(file_info.hIcon);
|
| + // Always notify the delegate, regardless of success.
|
| target_message_loop_->PostTask(FROM_HERE,
|
| base::Bind(&IconLoader::NotifyDelegate, this));
|
| }
|
|
|