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

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

Issue 250443002: Remove NOTIFICATION_EXTENSION_LOADED_DEPRECATED from MenuManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/menu_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/menu_manager.h
diff --git a/chrome/browser/extensions/menu_manager.h b/chrome/browser/extensions/menu_manager.h
index 9fdf1168909bb964ba918ea8171257ec329d5392..c94ffd080f69ca327d966d38a7552f87c6da550b 100644
--- a/chrome/browser/extensions/menu_manager.h
+++ b/chrome/browser/extensions/menu_manager.h
@@ -15,15 +15,16 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
#include "base/strings/string16.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_icon_manager.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
#include "extensions/common/url_pattern_set.h"
-
class Profile;
class SkBitmap;
@@ -34,6 +35,7 @@ struct ContextMenuParams;
namespace extensions {
class Extension;
+class ExtensionRegistry;
class StateStore;
// Represents a menu item added by an extension.
@@ -267,7 +269,8 @@ class MenuItem {
// This class keeps track of menu items added by extensions.
class MenuManager : public content::NotificationObserver,
public base::SupportsWeakPtr<MenuManager>,
- public KeyedService {
+ public KeyedService,
+ public ExtensionRegistryObserver {
public:
static const char kOnContextMenus[];
static const char kOnWebviewContextMenus[];
@@ -334,10 +337,18 @@ class MenuManager : public content::NotificationObserver,
// default extension icon.
const SkBitmap& GetIconForExtension(const std::string& extension_id);
- // Implements the content::NotificationObserver interface.
+ // content::NotificationObserver implementation.
virtual void Observe(int type, const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // ExtensionRegistryObserver implementation.
+ virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
+ const Extension* extension) OVERRIDE;
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ UnloadedExtensionInfo::Reason reason) OVERRIDE;
+
// Stores the menu items for the extension in the state storage.
void WriteToStorage(const Extension* extension,
const MenuItem::ExtensionKey& extension_key);
@@ -378,6 +389,10 @@ class MenuManager : public content::NotificationObserver,
content::NotificationRegistrar registrar_;
+ // Listen to extension load, unloaded notifications.
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
+ extension_registry_observer_;
+
ExtensionIconManager icon_manager_;
Profile* profile_;
« no previous file with comments | « no previous file | chrome/browser/extensions/menu_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698