OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/gfx/icon_util.h" | |
11 #include "base/gfx/size.h" | 10 #include "base/gfx/size.h" |
12 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
13 #include "base/thread.h" | 12 #include "base/thread.h" |
| 13 #include "gfx/icon_util.h" |
14 | 14 |
15 void IconLoader::ReadIcon() { | 15 void IconLoader::ReadIcon() { |
16 int size = 0; | 16 int size = 0; |
17 switch (icon_size_) { | 17 switch (icon_size_) { |
18 case IconLoader::SMALL: | 18 case IconLoader::SMALL: |
19 size = SHGFI_SMALLICON; | 19 size = SHGFI_SMALLICON; |
20 break; | 20 break; |
21 case IconLoader::NORMAL: | 21 case IconLoader::NORMAL: |
22 size = 0; | 22 size = 0; |
23 break; | 23 break; |
(...skipping 16 matching lines...) Expand all Loading... |
40 DCHECK(r); | 40 DCHECK(r); |
41 r = ::GetObject(icon_info.hbmMask, sizeof(bitmap_info), &bitmap_info); | 41 r = ::GetObject(icon_info.hbmMask, sizeof(bitmap_info), &bitmap_info); |
42 DCHECK(r); | 42 DCHECK(r); |
43 | 43 |
44 gfx::Size icon_size(bitmap_info.bmWidth, bitmap_info.bmHeight); | 44 gfx::Size icon_size(bitmap_info.bmWidth, bitmap_info.bmHeight); |
45 bitmap_ = IconUtil::CreateSkBitmapFromHICON(file_info.hIcon, icon_size); | 45 bitmap_ = IconUtil::CreateSkBitmapFromHICON(file_info.hIcon, icon_size); |
46 | 46 |
47 target_message_loop_->PostTask(FROM_HERE, | 47 target_message_loop_->PostTask(FROM_HERE, |
48 NewRunnableMethod(this, &IconLoader::NotifyDelegate)); | 48 NewRunnableMethod(this, &IconLoader::NotifyDelegate)); |
49 } | 49 } |
OLD | NEW |