summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_action_manager.h
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2014-08-28 14:06:55 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-28 21:08:21 +0000
commit9a1800e4df575c7f7035cfbfddb84dcf879d217c (patch)
treef2b1e94131faedfed1a17749c975e1cdc5d19697 /chrome/browser/extensions/extension_action_manager.h
parentdb0482c7dae49d6d35530d867deb995c7ae97fb3 (diff)
downloadchromium_src-9a1800e4df575c7f7035cfbfddb84dcf879d217c.zip
chromium_src-9a1800e4df575c7f7035cfbfddb84dcf879d217c.tar.gz
chromium_src-9a1800e4df575c7f7035cfbfddb84dcf879d217c.tar.bz2
Make a ShowExtensionActionPopup function
More-or-less consolidate calls to show an ExtensionAction's popup into ExtensionActionAPI. This has the happy effect of reducing the amount of piping we have to do in the UI code (cutting a few steps out of the Browser -> BrowserWindow -> Toolbar -> BrowserActionsContainer -> BrowserActionView chain), and, more importantly, lets page action command executions happen in the BrowserActionsContainer when the redesign is enabled. Hopefully, this means that we can stop showing page actions in the location bar with the switch enabled - but that's another patch. BUG=397259 TBR=sky@chromium.org (minor changes to test_browser_window) Review URL: https://codereview.chromium.org/489183005 Cr-Commit-Position: refs/heads/master@{#292462}
Diffstat (limited to 'chrome/browser/extensions/extension_action_manager.h')
-rw-r--r--chrome/browser/extensions/extension_action_manager.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/extensions/extension_action_manager.h b/chrome/browser/extensions/extension_action_manager.h
index 8973397..0d78277 100644
--- a/chrome/browser/extensions/extension_action_manager.h
+++ b/chrome/browser/extensions/extension_action_manager.h
@@ -33,21 +33,26 @@ class ExtensionActionManager : public KeyedService,
// shared between a profile and its incognito version.
static ExtensionActionManager* Get(content::BrowserContext* browser_context);
- // Retrieves the page action, or browser action for |extension|.
+ // Retrieves the page action, browser action, or system indicator 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* GetSystemIndicator(
- const extensions::Extension& extension) const;
+ ExtensionAction* GetPageAction(const Extension& extension) const;
+ ExtensionAction* GetBrowserAction(const Extension& extension) const;
+ ExtensionAction* GetSystemIndicator(const Extension& extension) const;
+
+ // Returns either the PageAction or BrowserAction for |extension|, or NULL if
+ // none exists. Since an extension can only declare one of Browser|PageAction,
+ // this is okay to use anywhere you need a generic "ExtensionAction".
+ // Since SystemIndicators are used differently and don't follow this
+ // rule of mutual exclusion, they are not checked or returned.
+ ExtensionAction* GetExtensionAction(const Extension& extension) const;
// Gets the best fit ExtensionAction for the given |extension|. This takes
// into account |extension|'s browser or page actions, if any, along with its
// name and any declared icons.
scoped_ptr<ExtensionAction> GetBestFitAction(
- const extensions::Extension& extension,
- extensions::ActionInfo::Type type) const;
+ const Extension& extension, ActionInfo::Type type) const;
private:
// Implement ExtensionRegistryObserver.