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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // chrome/browser/resources/file_manager/js/file_manager.js | 84 // chrome/browser/resources/file_manager/js/file_manager.js |
85 // chrome/browser/resources/file_manager/css/file_manager.css | 85 // chrome/browser/resources/file_manager/css/file_manager.css |
86 // 'audio': /\.(mp3|m4a|oga|ogg|wav)$/i, | 86 // 'audio': /\.(mp3|m4a|oga|ogg|wav)$/i, |
87 // 'html': /\.(html?)$/i, | 87 // 'html': /\.(html?)$/i, |
88 // 'image': /\.(bmp|gif|jpe?g|ico|png|webp)$/i, | 88 // 'image': /\.(bmp|gif|jpe?g|ico|png|webp)$/i, |
89 // 'pdf' : /\.(pdf)$/i, | 89 // 'pdf' : /\.(pdf)$/i, |
90 // 'text': /\.(pod|rst|txt|log)$/i, | 90 // 'text': /\.(pod|rst|txt|log)$/i, |
91 // 'video': /\.(mov|mp4|m4v|mpe?g4?|ogm|ogv|ogx|webm)$/i | 91 // 'video': /\.(mov|mp4|m4v|mpe?g4?|ogm|ogv|ogx|webm)$/i |
92 | 92 |
93 const ExtensionIconMap::value_type kExtensionIdrBySizeData[] = { | 93 const ExtensionIconMap::value_type kExtensionIdrBySizeData[] = { |
94 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 94 #if defined(USE_PROPRIETARY_CODECS) |
95 std::make_pair(".m4a", kAudioIdrs), | 95 std::make_pair(".m4a", kAudioIdrs), |
96 std::make_pair(".mp3", kAudioIdrs), | 96 std::make_pair(".mp3", kAudioIdrs), |
97 std::make_pair(".pdf", kPdfIdrs), | 97 std::make_pair(".pdf", kPdfIdrs), |
98 std::make_pair(".3gp", kVideoIdrs), | 98 std::make_pair(".3gp", kVideoIdrs), |
99 std::make_pair(".avi", kVideoIdrs), | 99 std::make_pair(".avi", kVideoIdrs), |
100 std::make_pair(".m4v", kVideoIdrs), | 100 std::make_pair(".m4v", kVideoIdrs), |
101 std::make_pair(".mov", kVideoIdrs), | 101 std::make_pair(".mov", kVideoIdrs), |
102 std::make_pair(".mp4", kVideoIdrs), | 102 std::make_pair(".mp4", kVideoIdrs), |
103 std::make_pair(".mpeg", kVideoIdrs), | 103 std::make_pair(".mpeg", kVideoIdrs), |
104 std::make_pair(".mpg", kVideoIdrs), | 104 std::make_pair(".mpg", kVideoIdrs), |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 LAZY_INSTANCE_INITIALIZER; | 193 LAZY_INSTANCE_INITIALIZER; |
194 int idr = icon_mapper.Get().Lookup(group_, icon_size_); | 194 int idr = icon_mapper.Get().Lookup(group_, icon_size_); |
195 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 195 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
196 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(), | 196 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(), |
197 IconSizeToDIPSize(icon_size_))); | 197 IconSizeToDIPSize(icon_size_))); |
198 image_skia.MakeThreadSafe(); | 198 image_skia.MakeThreadSafe(); |
199 image_.reset(new gfx::Image(image_skia)); | 199 image_.reset(new gfx::Image(image_skia)); |
200 target_message_loop_->PostTask( | 200 target_message_loop_->PostTask( |
201 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); | 201 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); |
202 } | 202 } |
OLD | NEW |