Index: chrome/browser/extensions/api/commands/command_service.h |
=================================================================== |
--- chrome/browser/extensions/api/commands/command_service.h (revision 149159) |
+++ chrome/browser/extensions/api/commands/command_service.h (working copy) |
@@ -49,10 +49,10 @@ |
explicit CommandService(Profile* profile); |
virtual ~CommandService(); |
- // Gets the keybinding (if any) for the browser action of an extension given |
+ // Gets the command (if any) for the browser action of an extension given |
// its |extension_id|. The function consults the master list to see if |
- // the keybinding is active. Returns false if the extension has no browser |
- // action. Returns false if the keybinding is not active and |type| requested |
+ // the command is active. Returns false if the extension has no browser |
+ // action. Returns false if the command is not active and |type| requested |
// is ACTIVE_ONLY. |command| contains the command found and |active| (if not |
// NULL) contains whether |command| is active. |
bool GetBrowserActionCommand(const std::string& extension_id, |
@@ -60,10 +60,10 @@ |
extensions::Command* command, |
bool* active); |
- // Gets the keybinding (if any) for the page action of an extension given |
+ // Gets the command (if any) for the page action of an extension given |
// its |extension_id|. The function consults the master list to see if |
- // the keybinding is active. Returns false if the extension has no page |
- // action. Returns false if the keybinding is not active and |type| requested |
+ // the command is active. Returns false if the extension has no page |
+ // action. Returns false if the command is not active and |type| requested |
// is ACTIVE_ONLY. |command| contains the command found and |active| (if not |
// NULL) contains whether |command| is active. |
bool GetPageActionCommand(const std::string& extension_id, |
@@ -71,9 +71,20 @@ |
extensions::Command* command, |
bool* active); |
- // Gets the active keybinding (if any) for the named commands of an extension |
+ // Gets the command (if any) for the script badge of an extension given |
+ // its |extension_id|. The function consults the master list to see if |
+ // the command is active. Returns false if the extension has no script |
+ // badge. Returns false if the command is not active and |type| requested |
+ // is ACTIVE_ONLY. |command| contains the command found and |active| (if not |
+ // NULL) contains whether |command| is active. |
+ bool GetScriptBadgeCommand(const std::string& extension_id, |
+ QueryType type, |
+ extensions::Command* command, |
+ bool* active); |
+ |
+ // Gets the active command (if any) for the named commands of an extension |
// given its |extension_id|. The function consults the master list to see if |
- // the keybinding is active. Returns an empty map if the extension has no |
+ // the command is active. Returns an empty map if the extension has no |
// named commands or no active named commands when |type| requested is |
// ACTIVE_ONLY. |
bool GetNamedCommands(const std::string& extension_id, |
@@ -112,6 +123,13 @@ |
const content::NotificationDetails& details) OVERRIDE; |
private: |
+ // An enum specifying the types of icons that can have a command. |
+ enum ExtensionActionType { |
+ BROWSER_ACTION, |
+ PAGE_ACTION, |
+ SCRIPT_BADGE, |
+ }; |
+ |
// Assigns initial keybinding for a given |extension|'s page action, browser |
// action and named commands. In each case, if the suggested keybinding is |
// free, it will be taken by this extension. If not, that keybinding request |
@@ -126,10 +144,10 @@ |
const std::string& command_name); |
bool GetExtensionActionCommand(const std::string& extension_id, |
- QueryType type, |
+ QueryType query_type, |
extensions::Command* command, |
bool* active, |
- bool browser_action); |
+ ExtensionActionType action_type); |
// The content notification registrar for listening to extension events. |
content::NotificationRegistrar registrar_; |