#ifndef CHROME_BROWSER_EXTENSIONS_APP_ICON_LOADER_IMPL_H_
#define CHROME_BROWSER_EXTENSIONS_APP_ICON_LOADER_IMPL_H_
#include <map>
#include <string>
#include "chrome/browser/extensions/app_icon_loader.h"
#include "chrome/browser/extensions/extension_icon_image.h"
class Profile;
namespace extensions {
class Extension;
class AppIconLoaderImpl : public AppIconLoader,
public extensions::IconImage::Observer {
public:
AppIconLoaderImpl(Profile* profile, int icon_size,
AppIconLoader::Delegate* delegate);
virtual ~AppIconLoaderImpl();
virtual void FetchImage(const std::string& id) OVERRIDE;
virtual void ClearImage(const std::string& id) OVERRIDE;
virtual void UpdateImage(const std::string& id) OVERRIDE;
virtual void OnExtensionIconImageChanged(
extensions::IconImage* image) OVERRIDE;
private:
typedef std::map<extensions::IconImage*, std::string> ImageToExtensionIDMap;
void BuildImage(const std::string& id, const gfx::ImageSkia& icon);
Profile* profile_;
AppIconLoader::Delegate* delegate_;
ImageToExtensionIDMap map_;
const int icon_size_;
DISALLOW_COPY_AND_ASSIGN(AppIconLoaderImpl);
};
}
#endif