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_loader.h | |
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_loader.h')
-rw-r--r-- | chrome/browser/icon_loader.h | 49 |
1 files changed, 10 insertions, 39 deletions
diff --git a/chrome/browser/icon_loader.h b/chrome/browser/icon_loader.h index 3505aae..ff1c5a4 100644 --- a/chrome/browser/icon_loader.h +++ b/chrome/browser/icon_loader.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ICON_LOADER_H__ -#define CHROME_BROWSER_ICON_LOADER_H__ +#ifndef CHROME_BROWSER_ICON_LOADER_H_ +#define CHROME_BROWSER_ICON_LOADER_H_ #include <string> -#include <windows.h> #include "base/basictypes.h" +#include "base/file_path.h" namespace { class IconLoaderProcessor; @@ -29,11 +29,6 @@ class SkBitmap; //////////////////////////////////////////////////////////////////////////////// class IconLoader { public: - enum IconType { - SK_BITMAP = 0, - WINDOWS_HICON - }; - enum IconSize { SMALL = 0, // 16x16 NORMAL, // 32x32 @@ -45,34 +40,19 @@ class IconLoader { // Invoked when an icon has been read. |source| is the IconLoader. If the // icon has been successfully loaded, result is non-null. This method must // return true if it is taking ownership of the returned bitmap. - // - // This method is only called when GetIconType() above returns SK_BITMAP. virtual bool OnSkBitmapLoaded(IconLoader* source, SkBitmap* result) = 0; - - // Invoked when the small and the large HICONS have been read. |source| is - // the IconLoader. If the small icon has been successfully loaded, - // small_icon is non-null. The same applies to the large_icon. This method - // must return true if it is taking ownership of the returned icon handles. - // - // This method is only called when GetIconType() above returns - // WINDOWS_HICON. - virtual bool OnHICONLoaded(IconLoader* source, - HICON small_icon, - HICON large_icon) = 0; }; // Create a new IconLoader that loads the icon from the data at contained in - // the file at |path|. |icon_type| specifies which format to generate and - // which method is invoked on the |delegate| once the icon was loaded. - static IconLoader* CreateIconLoaderForFile(const std::wstring& path, - IconType icon_type, + // the file at |path|. + static IconLoader* CreateIconLoaderForFile(const FilePath& path, Delegate* delegate); // Create a new IconLoader that loads the icon in the resource of the file // at |path|. This is used with .exe/.dll files. // Note that this generates a SkBitmap (and consequently OnSkBitmapLoaded is // invoked on the delegate once the load has completed). - static IconLoader* CreateIconLoaderForFileResource(const std::wstring& path, + static IconLoader* CreateIconLoaderForFileResource(const FilePath& path, IconSize size, Delegate* delegate); @@ -89,8 +69,7 @@ class IconLoader { friend class IconLoaderProcessor; // Use the factory methods CreateIconLoader* instead of using this constructor - IconLoader(const std::wstring& path, - IconType type, + IconLoader(const FilePath& path, bool from_resource, IconSize size, Delegate* delegate); @@ -99,12 +78,8 @@ class IconLoader { // object was requested. bool OnLoadComplete(SkBitmap* result); - // Invoked by the processor when the file has been read and HICON handles - // (small and large) were requested. - bool OnLoadComplete(HICON small_icon, HICON large_icon); - // The path. - std::wstring path_; + FilePath path_; // The delegate. Delegate* delegate_; @@ -117,14 +92,10 @@ class IconLoader { // Not used if loading_from_resource_ is false. IconSize icon_size_; - // The type of icon that should be generated. - // Not used if loading_from_resource_ is true. - IconType icon_type_; - // The underlying object performing the read. IconLoaderProcessor* processor_; - DISALLOW_EVIL_CONSTRUCTORS(IconLoader); + DISALLOW_COPY_AND_ASSIGN(IconLoader); }; -#endif // CHROME_BROWSER_ICON_LOADER_H__ +#endif // CHROME_BROWSER_ICON_LOADER_H_ |