Split extensions::MenuManager instance out from ExtensionService.
This is now its own BCKS. There was no need for it to be in
ExtensionService.
[email protected]
BUG=162530
Review URL: https://codereview.chromium.org/64953004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235120 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/menu_manager.h b/chrome/browser/extensions/menu_manager.h
index b3d085d3..ac0d7a3 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 @@
namespace extensions {
class Extension;
+class StateStore;
// Represents a menu item added by an extension.
class MenuItem {
@@ -243,11 +245,15 @@
// 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 @@
Profile* profile_;
+ // Owned by ExtensionSystem.
+ StateStore* store_;
+
DISALLOW_COPY_AND_ASSIGN(MenuManager);
};