summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/fileicon_source.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/dom_ui/fileicon_source.cc')
-rw-r--r--chrome/browser/dom_ui/fileicon_source.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/dom_ui/fileicon_source.cc b/chrome/browser/dom_ui/fileicon_source.cc
index d1e507c..7e8ef9b 100644
--- a/chrome/browser/dom_ui/fileicon_source.cc
+++ b/chrome/browser/dom_ui/fileicon_source.cc
@@ -31,7 +31,13 @@ void FileIconSource::StartDataRequest(const std::string& path,
std::replace(escaped_path.begin(), escaped_path.end(), '/', '\\');
// Fast look up.
- SkBitmap* icon = im->LookupIcon(UTF8ToWide(escaped_path), IconLoader::NORMAL);
+#if defined(OS_WIN)
+ FilePath escaped_filepath(UTF8ToWide(escaped_path));
+#else if defined(OS_POSIX)
+ // The correct encoding on Linux may not actually be UTF8.
+ FilePath escaped_filepath(escaped_path);
+#endif
+ SkBitmap* icon = im->LookupIcon(escaped_filepath, IconLoader::NORMAL);
if (icon) {
std::vector<unsigned char> png_bytes;
@@ -41,7 +47,7 @@ void FileIconSource::StartDataRequest(const std::string& path,
SendResponse(request_id, icon_data);
} else {
// Icon was not in cache, go fetch it slowly.
- IconManager::Handle h = im->LoadIcon(UTF8ToWide(escaped_path),
+ IconManager::Handle h = im->LoadIcon(escaped_filepath,
IconLoader::NORMAL,
&cancelable_consumer_,
NewCallback(this, &FileIconSource::OnFileIconDataAvailable));