#include "extensions/browser/extension_icon_image.h"
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "base/task/single_thread_task_runner.h"
#include "extensions/browser/image_loader.h"
#include "extensions/common/extension.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/image/canvas_image_source.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/image/image_skia_source.h"
namespace {
extensions::ExtensionResource GetExtensionIconResource(
const extensions::Extension& extension,
const ExtensionIconSet& icons,
int size,
ExtensionIconSet::Match match_type) { … }
class BlankImageSource : public gfx::CanvasImageSource { … };
}
namespace extensions {
class IconImage::Source : public gfx::ImageSkiaSource { … };
IconImage::Source::Source(IconImage* host, const gfx::Size& size_in_dip)
: … { … }
IconImage::Source::~Source() { … }
void IconImage::Source::ResetHost() { … }
gfx::ImageSkiaRep IconImage::Source::GetImageForScale(float scale) { … }
IconImage::IconImage(content::BrowserContext* context,
const Extension* extension,
const ExtensionIconSet& icon_set,
int resource_size_in_dip,
bool keep_original_size,
const gfx::ImageSkia& default_icon,
Observer* observer)
: … { … }
IconImage::IconImage(content::BrowserContext* context,
const Extension* extension,
const ExtensionIconSet& icon_set,
int resource_size_in_dip,
const gfx::ImageSkia& default_icon,
Observer* observer)
: … { … }
void IconImage::AddObserver(Observer* observer) { … }
void IconImage::RemoveObserver(Observer* observer) { … }
IconImage::~IconImage() { … }
void IconImage::LoadImageForScaleAsync(float scale) { … }
void IconImage::OnImageLoaded(float scale, const gfx::Image& image_in) { … }
void IconImage::OnImageRepLoaded(const gfx::ImageSkiaRep& rep) { … }
void IconImage::OnExtensionUnloaded(content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionReason reason) { … }
void IconImage::OnShutdown(ExtensionRegistry* extension_registry) { … }
}