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

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

Issue 64953004: Split extensions::MenuManager instance out from ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Explicit nit Created 7 years, 1 month 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 | « chrome/browser/extensions/extension_service.cc ('k') | 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 b3d085d350f3475df0db066dcec71244d15a909b..ac0d7a33797dec7acee1ae662cef78d9ff8414ce 100644
--- a/chrome/browser/extensions/menu_manager.h
+++ b/chrome/browser/extensions/menu_manager.h
@@ -18,6 +18,7 @@
#include "base/strings/string16.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_icon_manager.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/common/url_pattern_set.h"
@@ -33,6 +34,7 @@ struct ContextMenuParams;
namespace extensions {
class Extension;
+class StateStore;
// Represents a menu item added by an extension.
class MenuItem {
@@ -243,11 +245,15 @@ class MenuItem {
// This class keeps track of menu items added by extensions.
class MenuManager : public content::NotificationObserver,
- public base::SupportsWeakPtr<MenuManager> {
+ public base::SupportsWeakPtr<MenuManager>,
+ public BrowserContextKeyedService {
public:
- explicit MenuManager(Profile* profile);
+ MenuManager(Profile* profile, StateStore* store_);
virtual ~MenuManager();
+ // Convenience function to get the MenuManager for a Profile.
+ static MenuManager* Get(Profile* profile);
+
// Returns the ids of extensions which have menu items registered.
std::set<std::string> ExtensionIds();
@@ -351,6 +357,9 @@ class MenuManager : public content::NotificationObserver,
Profile* profile_;
+ // Owned by ExtensionSystem.
+ StateStore* store_;
+
DISALLOW_COPY_AND_ASSIGN(MenuManager);
};
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/menu_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698