| OLD | NEW |
| 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 #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 12 matching lines...) Expand all Loading... |
| 23 if (file_path.MatchesExtension(L".exe") || | 23 if (file_path.MatchesExtension(L".exe") || |
| 24 file_path.MatchesExtension(L".dll") || | 24 file_path.MatchesExtension(L".dll") || |
| 25 file_path.MatchesExtension(L".ico")) { | 25 file_path.MatchesExtension(L".ico")) { |
| 26 return file_path.value(); | 26 return file_path.value(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 return file_path.Extension(); | 29 return file_path.Extension(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 // static | 32 // static |
| 33 content::BrowserThread::ID IconLoader::ReadIconThreadID() { | 33 bool IconLoader::ReadIconRequiresUIThread() { |
| 34 return content::BrowserThread::FILE; | 34 return false; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void IconLoader::ReadIcon() { | 37 void IconLoader::ReadIcon() { |
| 38 int size = 0; | 38 int size = 0; |
| 39 switch (icon_size_) { | 39 switch (icon_size_) { |
| 40 case IconLoader::SMALL: | 40 case IconLoader::SMALL: |
| 41 size = SHGFI_SMALLICON; | 41 size = SHGFI_SMALLICON; |
| 42 break; | 42 break; |
| 43 case IconLoader::NORMAL: | 43 case IconLoader::NORMAL: |
| 44 size = 0; | 44 size = 0; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 64 image_skia.MakeThreadSafe(); | 64 image_skia.MakeThreadSafe(); |
| 65 image = base::MakeUnique<gfx::Image>(image_skia); | 65 image = base::MakeUnique<gfx::Image>(image_skia); |
| 66 DestroyIcon(file_info.hIcon); | 66 DestroyIcon(file_info.hIcon); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 target_task_runner_->PostTask( | 70 target_task_runner_->PostTask( |
| 71 FROM_HERE, base::Bind(callback_, base::Passed(&image), group_)); | 71 FROM_HERE, base::Bind(callback_, base::Passed(&image), group_)); |
| 72 delete this; | 72 delete this; |
| 73 } | 73 } |
| OLD | NEW |