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

Unified Diff: chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc

Issue 838253004: MacViews: Fix duplicate definition of ExtensionKeyBindingRegistry::SetShortcutHandlingSuspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DragBookmarks2
Patch Set: Created 5 years, 11 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/ui/views/extensions/extension_keybinding_registry_views.cc
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 d0fb3daeee0fdc768d7c5254e98ee47fe8180de5..2a084e963d21fc3343bd15a6861451e87db70459 100644
--- a/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc
+++ b/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc
@@ -11,12 +11,6 @@
#include "extensions/common/extension.h"
#include "ui/views/focus/focus_manager.h"
-// static
-void extensions::ExtensionKeybindingRegistry::SetShortcutHandlingSuspended(
- bool suspended) {
- views::FocusManager::set_shortcut_handling_suspended(suspended);
-}
-
ExtensionKeybindingRegistryViews::ExtensionKeybindingRegistryViews(
Profile* profile,
views::FocusManager* focus_manager,
@@ -26,9 +20,11 @@ ExtensionKeybindingRegistryViews::ExtensionKeybindingRegistryViews(
profile_(profile),
focus_manager_(focus_manager) {
Init();
+ focus_manager->AddAcceleratorPreProcessor(this);
Devlin 2015/01/09 17:09:26 This is somewhat less definitive than the old impl
}
ExtensionKeybindingRegistryViews::~ExtensionKeybindingRegistryViews() {
+ focus_manager_->RemoveAcceleratorProcessor(this);
focus_manager_->UnregisterAccelerators(this);
}
@@ -70,6 +66,18 @@ void ExtensionKeybindingRegistryViews::RemoveExtensionKeybindingImpl(
focus_manager_->UnregisterAccelerator(accelerator, this);
}
+bool ExtensionKeybindingRegistryViews::ProcessAccelerator(
+ const ui::Accelerator& accelerator) {
+ // Consume the accelerator if shortcut handling is suspended.
+ return IsShortcutHandlingSuspended();
+}
+
+ui::AcceleratorTarget*
+ExtensionKeybindingRegistryViews::GetTargetForAccelerator(
+ const ui::Accelerator& accelerator) const {
+ return nullptr;
+}
+
bool ExtensionKeybindingRegistryViews::AcceleratorPressed(
const ui::Accelerator& accelerator) {
std::string extension_id, command_name;

Powered by Google App Engine
This is Rietveld 408576698