Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: chrome/browser/extensions/extension_icon_manager.h

Issue 2576833002: Make some updates to extension iconography. (Closed)
Patch Set: add test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_icon_manager.h
diff --git a/chrome/browser/extensions/extension_icon_manager.h b/chrome/browser/extensions/extension_icon_manager.h
index f79f0fbe56f68e303f2014b3f07181d543da0776..1949b6578c2650a3fb2d16fdc8b9249d5bdc0d70 100644
--- a/chrome/browser/extensions/extension_icon_manager.h
+++ b/chrome/browser/extensions/extension_icon_manager.h
@@ -11,8 +11,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/gfx/geometry/insets.h"
+#include "ui/gfx/image/image.h"
namespace content {
class BrowserContext;
@@ -35,16 +34,15 @@ class ExtensionIconManager {
void LoadIcon(content::BrowserContext* context,
const extensions::Extension* extension);
- // This returns a bitmap of width/height kFaviconSize, loaded either from an
+ // This returns an image of width/height kFaviconSize, loaded either from an
// entry specified in the extension's 'icon' section of the manifest, or a
// default extension icon.
- const SkBitmap& GetIcon(const std::string& extension_id);
+ gfx::Image GetIcon(const std::string& extension_id);
// Removes the extension's icon from memory.
void RemoveIcon(const std::string& extension_id);
void set_monochrome(bool value) { monochrome_ = value; }
- void set_padding(const gfx::Insets& value) { padding_ = value; }
protected:
virtual void OnImageLoaded(const std::string& extension_id,
@@ -55,25 +53,18 @@ class ExtensionIconManager {
// default_icon_.
void EnsureDefaultIcon();
- // Helper function to return a copy of |src| with the proper scaling and
- // coloring.
- SkBitmap ApplyTransforms(const SkBitmap& src);
-
- // Maps extension id to an SkBitmap with the icon for that extension.
- std::map<std::string, SkBitmap> icons_;
+ // Maps extension id to the icon for that extension.
+ std::map<std::string, gfx::Image> icons_;
// Set of extension IDs waiting for icons to load.
std::set<std::string> pending_icons_;
// The default icon we'll use if an extension doesn't have one.
- SkBitmap default_icon_;
+ gfx::Image default_icon_;
// If true, we will desaturate the icons to make them monochromatic.
bool monochrome_;
- // Specifies the amount of empty padding to place around the icon.
- gfx::Insets padding_;
-
base::WeakPtrFactory<ExtensionIconManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ExtensionIconManager);

Powered by Google App Engine
This is Rietveld 408576698