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

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: unit tests compile 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
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..1d8a3c33a69e4d1d4a383bd63630670bc92846ba 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);
+ explicit MenuManager(Profile* profile, StateStore* store_);
James Cook 2013/11/13 17:04:31 nit: no need for explicit
benwells 2013/11/14 01:44:43 oops, done.
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);
};

Powered by Google App Engine
This is Rietveld 408576698