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

Unified Diff: chrome/browser/extensions/menu_manager_factory.cc

Issue 359493005: Extend contextMenus API to support browser/page actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fixes Created 6 years, 5 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/menu_manager_factory.cc
diff --git a/chrome/browser/extensions/menu_manager_factory.cc b/chrome/browser/extensions/menu_manager_factory.cc
index c90d888a4f34656e3edfa2bd30569ddebf5970d4..b02f671666dcd0c90563a54cf78816880b9ef02f 100644
--- a/chrome/browser/extensions/menu_manager_factory.cc
+++ b/chrome/browser/extensions/menu_manager_factory.cc
@@ -25,6 +25,13 @@ MenuManagerFactory* MenuManagerFactory::GetInstance() {
return Singleton<MenuManagerFactory>::get();
}
+// static
+KeyedService* MenuManagerFactory::BuildInstanceFor(
Devlin 2014/07/24 21:51:28 If you're gonna do this, why not just make BuildSe
gpdavis 2014/07/28 21:08:22 BuildServiceInstanceFor is an overridden non-stati
Yoyo Zhou 2014/07/28 23:23:25 We have presubmits that warn about the use of meth
+ content::BrowserContext* context) {
+ Profile* profile = Profile::FromBrowserContext(context);
+ return new MenuManager(profile, ExtensionSystem::Get(profile)->state_store());
+}
+
MenuManagerFactory::MenuManagerFactory()
: BrowserContextKeyedServiceFactory(
"MenuManager",
@@ -36,10 +43,7 @@ MenuManagerFactory::~MenuManagerFactory() {}
KeyedService* MenuManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
- Profile* profile = Profile::FromBrowserContext(context);
- return new MenuManager(
- profile,
- ExtensionSystem::Get(profile)->state_store());
+ return BuildInstanceFor(context);
}
content::BrowserContext* MenuManagerFactory::GetBrowserContextToUse(

Powered by Google App Engine
This is Rietveld 408576698