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..ac553aa318c1a4464449ffccd543ae1e6ee10678 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, // Regular (non-globally scoped) command. |
+ GLOBAL, // Global command (works when Chrome doesn't have focus) |
+ ANY_SCOPE, // All commands, regardless of scope (used when querying). |
+ }; |
+ |
// 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 such active named commands when |
+ // |type| 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 |
@@ -175,6 +185,9 @@ class CommandService : public ProfileKeyedAPI, |
DISALLOW_COPY_AND_ASSIGN(CommandService); |
}; |
+template <> |
+void ProfileKeyedAPIFactory<CommandService>::DeclareFactoryDependencies(); |
+ |
} // namespace extensions |
#endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ |