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

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

Issue 885443004: [Extensions] Cache extension action icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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_action_icon_factory.h
diff --git a/chrome/browser/extensions/extension_action_icon_factory.h b/chrome/browser/extensions/extension_action_icon_factory.h
index 3860216e8c5ae742839f208443487a309ab97ac1..25d05ad2234ddcc3125770029c4decc7c46ed461 100644
--- a/chrome/browser/extensions/extension_action_icon_factory.h
+++ b/chrome/browser/extensions/extension_action_icon_factory.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_ICON_FACTORY_H_
#include "base/memory/scoped_ptr.h"
+#include "base/scoped_observer.h"
#include "extensions/browser/extension_icon_image.h"
class ExtensionAction;
@@ -33,12 +34,13 @@ class ExtensionActionIconFactory : public extensions::IconImage::Observer {
// Observer should outlive this.
ExtensionActionIconFactory(Profile* profile,
const extensions::Extension* extension,
- const ExtensionAction* action,
+ ExtensionAction* action,
Observer* observer);
~ExtensionActionIconFactory() override;
// extensions::IconImage override.
void OnExtensionIconImageChanged(extensions::IconImage* image) override;
+ void OnExtensionIconImageDestroyed(extensions::IconImage* image) override;
// Gets the extension action icon for the tab.
// If there is an icon set using |SetIcon|, that icon is returned.
@@ -58,8 +60,9 @@ class ExtensionActionIconFactory : public extensions::IconImage::Observer {
const extensions::Extension* extension_;
const ExtensionAction* action_;
Observer* observer_;
- // Underlying icon image for the default icon.
- scoped_ptr<extensions::IconImage> default_icon_;
+
+ ScopedObserver<extensions::IconImage, extensions::IconImage::Observer>
+ icon_image_observer_;
DISALLOW_COPY_AND_ASSIGN(ExtensionActionIconFactory);
};
« no previous file with comments | « chrome/browser/extensions/extension_action.cc ('k') | chrome/browser/extensions/extension_action_icon_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698