summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc')
-rw-r--r--chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc27
1 files changed, 7 insertions, 20 deletions
diff --git a/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc b/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc
index 1531847..61f4915 100644
--- a/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc
+++ b/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc
@@ -47,7 +47,10 @@ void ExtensionKeybindingRegistryViews::AddExtensionKeybinding(
// which are handled elsewhere).
extensions::CommandMap commands;
if (!command_service->GetNamedCommands(
- extension->id(), extensions::CommandService::ACTIVE_ONLY, &commands))
+ extension->id(),
+ extensions::CommandService::ACTIVE_ONLY,
+ extensions::CommandService::REGULAR,
+ &commands))
return;
extensions::CommandMap::const_iterator iter = commands.begin();
for (; iter != commands.end(); ++iter) {
@@ -62,26 +65,10 @@ void ExtensionKeybindingRegistryViews::AddExtensionKeybinding(
}
}
-void ExtensionKeybindingRegistryViews::RemoveExtensionKeybinding(
- const extensions::Extension* extension,
+void ExtensionKeybindingRegistryViews::RemoveExtensionKeybindingImpl(
+ const ui::Accelerator& accelerator,
const std::string& command_name) {
- // This object only handles named commands, not browser/page actions.
- if (ShouldIgnoreCommand(command_name))
- return;
-
- EventTargets::iterator iter = event_targets_.begin();
- while (iter != event_targets_.end()) {
- if (iter->second.first != extension->id() ||
- (!command_name.empty() && (iter->second.second != command_name))) {
- ++iter;
- continue; // Not the extension or command we asked for.
- }
-
- focus_manager_->UnregisterAccelerator(iter->first, this);
-
- EventTargets::iterator old = iter++;
- event_targets_.erase(old);
- }
+ focus_manager_->UnregisterAccelerator(accelerator, this);
}
bool ExtensionKeybindingRegistryViews::AcceleratorPressed(