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_; |