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

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

Issue 10911300: Move ExtensionAction from common/ to browser/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: proof of concept Created 8 years, 3 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/extension_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index bb31d3d99d2b430589f57bb3061c0bb7e42849fe..0d927188d1151428d0867f31e5589788d4d92ae8 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -22,6 +22,7 @@
#include "chrome/browser/api/prefs/pref_change_registrar.h"
#include "chrome/browser/extensions/app_shortcut_manager.h"
#include "chrome/browser/extensions/app_sync_bundle.h"
+#include "chrome/browser/extensions/extension_action.h"
#include "chrome/browser/extensions/extension_icon_manager.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_process_manager.h"
@@ -394,6 +395,14 @@ class ExtensionService
// extension.
gfx::Image GetOmniboxPopupIcon(const std::string& extension_id);
+ // Retrieves the page action, browser action, or script badge for |extension|.
+ // If the result is not NULL, it remains valid until the extension is
+ // unloaded.
+ ExtensionAction* GetPageAction(const extensions::Extension& extension) const;
+ ExtensionAction* GetBrowserAction(
+ const extensions::Extension& extension) const;
+ ExtensionAction* GetScriptBadge(const extensions::Extension& extension) const;
+
// Called when the initial extensions load has completed.
virtual void OnLoadedInstalledExtensions();
@@ -819,6 +828,14 @@ class ExtensionService
// Flag to make sure event routers are only initialized once.
bool event_routers_initialized_;
+ // Keyed by Extension ID. These maps are populated when the extension is
+ // loaded, and the entries are removed when the extension is unloaded. Not
+ // every extension has a page action or browser action, but all have a script
+ // badge.
+ std::map<std::string, ExtensionAction*> page_actions_;
Jeffrey Yasskin 2012/09/14 19:18:33 These actually need to be stored in an ExtensionAc
Aaron Boodman 2012/09/16 01:42:50 Per current design, it should be ExtensionSystem.
+ std::map<std::string, ExtensionAction*> browser_actions_;
+ std::map<std::string, ExtensionAction*> script_badges_;
+
scoped_ptr<HistoryExtensionEventRouter> history_event_router_;
scoped_ptr<extensions::BrowserEventRouter> browser_event_router_;

Powered by Google App Engine
This is Rietveld 408576698