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

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

Issue 23812010: Implement first part of supporting global extension commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No change, just reuploading (last attempt was incomplete) Created 7 years, 2 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
diff --git a/chrome/browser/extensions/api/commands/command_service.h b/chrome/browser/extensions/api/commands/command_service.h
index d857eb73e603c7850b8f7affad893e2f8dc5f524..bd818a093ef627f1dccfb5f8b009549524a6210c 100644
--- a/chrome/browser/extensions/api/commands/command_service.h
+++ b/chrome/browser/extensions/api/commands/command_service.h
@@ -45,6 +45,15 @@ class CommandService : public ProfileKeyedAPI,
ACTIVE_ONLY,
};
+ // An enum specifying whether the command is global in scope or not. Global
+ // commands -- unlike regular commands -- have a global keyboard hook
+ // associated with them (and therefore work when Chrome doesn't have focus).
+ enum CommandScope {
+ REGULAR,
+ GLOBAL,
+ ANY_SCOPE,
Yoyo Zhou 2013/10/03 22:08:50 What does this mean? (This is only used for queryi
Finnur 2013/10/04 17:57:02 Added comments. On 2013/10/03 22:08:50, Yoyo Zhou
+ };
+
// Register prefs for keybinding.
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
@@ -94,10 +103,11 @@ class CommandService : public ProfileKeyedAPI,
// 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 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.
+ // named commands of the right |scope| or no active named commands when |type|
Yoyo Zhou 2013/10/03 22:08:50 ..."no such active named commands"...?
Finnur 2013/10/04 17:57:02 Done.
+ // requested is ACTIVE_ONLY.
bool GetNamedCommands(const std::string& extension_id,
QueryType type,
+ CommandScope scope,
extensions::CommandMap* command_map);
// Records a keybinding |accelerator| as active for an extension with id

Powered by Google App Engine
This is Rietveld 408576698