diff options
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/downloads_ui.cc | 3 | ||||
-rw-r--r-- | chrome/browser/dom_ui/fileicon_source.cc | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/downloads_ui.cc b/chrome/browser/dom_ui/downloads_ui.cc index cd3ac91..1bc5794 100644 --- a/chrome/browser/dom_ui/downloads_ui.cc +++ b/chrome/browser/dom_ui/downloads_ui.cc @@ -329,8 +329,7 @@ void DownloadsDOMHandler::HandleDrag(const Value* value) { DownloadItem* file = GetDownloadByValue(value); if (file) { IconManager* im = g_browser_process->icon_manager(); - SkBitmap* icon = im->LookupIcon(file->full_path().ToWStringHack(), - IconLoader::NORMAL); + SkBitmap* icon = im->LookupIcon(file->full_path(), IconLoader::NORMAL); download_util::DragDownload(file, icon); } } 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)); |