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/icon_manager.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/icon_manager.cc')
-rw-r--r-- | chrome/browser/icon_manager.cc | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/chrome/browser/icon_manager.cc b/chrome/browser/icon_manager.cc index f75e93b..0513a81 100644 --- a/chrome/browser/icon_manager.cc +++ b/chrome/browser/icon_manager.cc @@ -17,12 +17,14 @@ IconManager::~IconManager() { STLDeleteValues(&icon_cache_); } -SkBitmap* IconManager::LookupIcon(const std::wstring& file_name, +SkBitmap* IconManager::LookupIcon(const FilePath& file_name, IconLoader::IconSize size) { - std::wstring path = file_name; - std::wstring extension = file_util::GetFileExtensionFromPath(path); + FilePath path = file_name; + FilePath::StringType extension = file_util::GetFileExtensionFromPath(path); +#if defined(OS_WIN) if (extension != L"exe" && extension != L"dll" && extension != L"ico") - path = L'.' + extension; + path = FilePath(L'.' + extension); +#endif IconMap::iterator it = icon_cache_.find(CacheKey(path, size)); if (it != icon_cache_.end()) @@ -32,14 +34,16 @@ SkBitmap* IconManager::LookupIcon(const std::wstring& file_name, } IconManager::Handle IconManager::LoadIcon( - const std::wstring& file_name, + const FilePath& file_name, IconLoader::IconSize size, CancelableRequestConsumerBase* consumer, IconRequestCallback* callback) { - std::wstring path = file_name; - std::wstring extension = file_util::GetFileExtensionFromPath(path); + FilePath path = file_name; + FilePath::StringType extension = file_util::GetFileExtensionFromPath(path); +#if defined(OS_WIN) if (extension != L"exe" && extension != L"dll" && extension != L"ico") - path = L'.' + extension; + path = FilePath(L'.' + extension); +#endif IconRequest* request = new IconRequest(callback); AddRequest(request, consumer); @@ -91,14 +95,7 @@ bool IconManager::OnSkBitmapLoaded(IconLoader* source, SkBitmap* result) { return true; // Indicates we took ownership of result. } -bool IconManager::OnHICONLoaded(IconLoader* source, - HICON small_icon, - HICON large_icon) { - NOTREACHED(); - return false; -} - -IconManager::CacheKey::CacheKey(std::wstring file_name, +IconManager::CacheKey::CacheKey(const FilePath& file_name, IconLoader::IconSize size) : file_name(file_name), size(size) { |