Index: chrome/browser/extensions/api/commands/command_service.cc |
diff --git a/chrome/browser/extensions/api/commands/command_service.cc b/chrome/browser/extensions/api/commands/command_service.cc |
index 5d38936f1aba3355f5fa43942d57741e4bc2eae1..7faadb9e2bb7904ffbd1155e3e51cf39e2670c8c 100644 |
--- a/chrome/browser/extensions/api/commands/command_service.cc |
+++ b/chrome/browser/extensions/api/commands/command_service.cc |
@@ -125,6 +125,7 @@ bool CommandService::GetScriptBadgeCommand( |
bool CommandService::GetNamedCommands(const std::string& extension_id, |
QueryType type, |
+ CommandScope scope, |
extensions::CommandMap* command_map) { |
const ExtensionSet* extensions = |
ExtensionSystem::Get(profile_)->extension_service()->extensions(); |
@@ -146,6 +147,9 @@ bool CommandService::GetNamedCommands(const std::string& extension_id, |
continue; |
extensions::Command command = iter->second; |
+ if (scope != ANY_SCOPE && ((scope == GLOBAL) != command.global())) |
+ continue; |
+ |
if (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN) |
command.set_accelerator(shortcut_assigned); |