diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 23:25:16 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 23:25:16 +0000 |
commit | 7ced67afd4697451a3b8bca6a1f999f971372160 (patch) | |
tree | cbac96b263e9200acfc962135abe376b4db190a7 /chrome/browser/dom_ui/fileicon_source.cc | |
parent | eca8ea527628d494c527753aaa781f3b34337e8f (diff) | |
download | chromium_src-7ced67afd4697451a3b8bca6a1f999f971372160.zip chromium_src-7ced67afd4697451a3b8bca6a1f999f971372160.tar.gz chromium_src-7ced67afd4697451a3b8bca6a1f999f971372160.tar.bz2 |
Clean up icon loader/manager in preparation for porting.
Remove a bunch of unused functions and change wstrings to filepaths and remove an obsolete enum.
Review URL: http://codereview.chromium.org/73007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13718 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/fileicon_source.cc')
-rw-r--r-- | chrome/browser/dom_ui/fileicon_source.cc | 10 |
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)); |