Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_view.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc |
| index 83c7cc90690bd9e71a68adff72c43be652a0082e..6e43d692bda91cf48dfea9b6ebcf22a6dee055f6 100644 |
| --- a/chrome/browser/ui/views/frame/browser_view.cc |
| +++ b/chrome/browser/ui/views/frame/browser_view.cc |
| @@ -19,6 +19,7 @@ |
| #include "chrome/browser/bookmarks/bookmark_stats.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| +#include "chrome/browser/extensions/extension_keybinding_registry.h" |
| #include "chrome/browser/extensions/extension_util.h" |
| #include "chrome/browser/extensions/tab_helper.h" |
| #include "chrome/browser/infobars/infobar_service.h" |
| @@ -1375,10 +1376,7 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| return false; |
| } |
| - views::FocusManager* focus_manager = GetFocusManager(); |
| - DCHECK(focus_manager); |
| - |
| - if (focus_manager->shortcut_handling_suspended()) |
| + if (extensions::ExtensionKeybindingRegistry::IsShortcutHandlingSuspended()) |
|
sky
2015/01/08 23:39:25
Could this be implemented by as a PreTargetHandler
Andre
2015/01/10 00:48:11
Thanks for the idea!
PTAL at patch #5, using Event
|
| return false; |
| ui::Accelerator accelerator = |
| @@ -1414,6 +1412,8 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| // If the |accelerator| is a non-browser shortcut (e.g. Ash shortcut), the |
| // command execution cannot be blocked and true is returned. However, it is |
| // okay as long as is_app() is false. See comments in this function. |
| + views::FocusManager* focus_manager = GetFocusManager(); |
| + DCHECK(focus_manager); |
| const bool processed = focus_manager->ProcessAccelerator(accelerator); |
| const int id = controller->GetLastBlockedCommand(nullptr); |
| controller->SetBlockCommandExecution(original_block_command_state); |