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 <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 const IdrBySize kGenericIdrs = { | 61 const IdrBySize kGenericIdrs = { |
62 IDR_FILE_MANAGER_IMG_FILETYPE_GENERIC, | 62 IDR_FILE_MANAGER_IMG_FILETYPE_GENERIC, |
63 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_GENERIC, | 63 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_GENERIC, |
64 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_GENERIC | 64 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_GENERIC |
65 }; | 65 }; |
66 const IdrBySize kImageIdrs = { | 66 const IdrBySize kImageIdrs = { |
67 IDR_FILE_MANAGER_IMG_FILETYPE_IMAGE, | 67 IDR_FILE_MANAGER_IMG_FILETYPE_IMAGE, |
68 IDR_FILE_MANAGER_IMG_FILETYPE_IMAGE, | 68 IDR_FILE_MANAGER_IMG_FILETYPE_IMAGE, |
69 IDR_FILE_MANAGER_IMG_FILETYPE_IMAGE | 69 IDR_FILE_MANAGER_IMG_FILETYPE_IMAGE |
70 }; | 70 }; |
| 71 #if defined(USE_PROPRIETARY_CODECS) |
71 const IdrBySize kPdfIdrs = { | 72 const IdrBySize kPdfIdrs = { |
72 IDR_FILE_MANAGER_IMG_FILETYPE_PDF, | 73 IDR_FILE_MANAGER_IMG_FILETYPE_PDF, |
73 IDR_FILE_MANAGER_IMG_FILETYPE_PDF, | 74 IDR_FILE_MANAGER_IMG_FILETYPE_PDF, |
74 IDR_FILE_MANAGER_IMG_FILETYPE_PDF | 75 IDR_FILE_MANAGER_IMG_FILETYPE_PDF |
75 }; | 76 }; |
| 77 #endif |
76 const IdrBySize kVideoIdrs = { | 78 const IdrBySize kVideoIdrs = { |
77 IDR_FILE_MANAGER_IMG_FILETYPE_VIDEO, | 79 IDR_FILE_MANAGER_IMG_FILETYPE_VIDEO, |
78 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_VIDEO, | 80 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_VIDEO, |
79 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_VIDEO | 81 IDR_FILE_MANAGER_IMG_FILETYPE_LARGE_VIDEO |
80 }; | 82 }; |
81 | 83 |
82 IconMapper::IconMapper() { | 84 IconMapper::IconMapper() { |
83 // The code below should match translation in | 85 // The code below should match translation in |
84 // chrome/browser/resources/file_manager/js/file_manager.js | 86 // chrome/browser/resources/file_manager/js/file_manager.js |
85 // chrome/browser/resources/file_manager/css/file_manager.css | 87 // chrome/browser/resources/file_manager/css/file_manager.css |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 LAZY_INSTANCE_INITIALIZER; | 195 LAZY_INSTANCE_INITIALIZER; |
194 int idr = icon_mapper.Get().Lookup(group_, icon_size_); | 196 int idr = icon_mapper.Get().Lookup(group_, icon_size_); |
195 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 197 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
196 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(), | 198 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(), |
197 IconSizeToDIPSize(icon_size_))); | 199 IconSizeToDIPSize(icon_size_))); |
198 image_skia.MakeThreadSafe(); | 200 image_skia.MakeThreadSafe(); |
199 image_.reset(new gfx::Image(image_skia)); | 201 image_.reset(new gfx::Image(image_skia)); |
200 target_message_loop_->PostTask( | 202 target_message_loop_->PostTask( |
201 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); | 203 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); |
202 } | 204 } |
OLD | NEW |