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

Unified Diff: chrome/browser/extensions/api/commands/command_service.h

Issue 10834106: Implement Keybinding for script badges. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/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_;

Powered by Google App Engine
This is Rietveld 408576698