| Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| index 3ddde63bcce6dc21dcdc039133f8898c510d971f..d9cc8b301968ee882bea91803d0b6be6bd6f8913 100644
|
| --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| +#include "base/debug/stack_trace.h"
|
| #include "base/logging.h"
|
| #import "base/mac/sdk_forward_declarations.h"
|
| #include "base/message_loop/message_loop.h"
|
| @@ -582,32 +583,41 @@ void BrowserWindowCocoa::ShowAppMenu() {
|
| content::KeyboardEventProcessingResult
|
| BrowserWindowCocoa::PreHandleKeyboardEvent(
|
| const NativeWebKeyboardEvent& event) {
|
| + base::debug::StackTrace s;
|
| + LOG(ERROR) << "BrowserWindowCocoa::PreHandleKeyboardEvent\n" << s.ToString();
|
| // Handle ESC to dismiss permission bubbles, but still forward it
|
| // to the window afterwards.
|
| if (event.windows_key_code == ui::VKEY_ESCAPE)
|
| [controller_ dismissPermissionBubble];
|
|
|
| - if (![BrowserWindowUtils shouldHandleKeyboardEvent:event])
|
| + if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) {
|
| + LOG(ERROR) << " > early exit; shouldn't handle event";
|
| return content::KeyboardEventProcessingResult::NOT_HANDLED;
|
| + }
|
|
|
| if (event.GetType() == blink::WebInputEvent::kRawKeyDown &&
|
| [controller_
|
| handledByExtensionCommand:event.os_event
|
| - priority:ui::AcceleratorManager::kHighPriority])
|
| + priority:ui::AcceleratorManager::kHighPriority]) {
|
| + LOG(ERROR) << " > handled by extension command";
|
| return content::KeyboardEventProcessingResult::HANDLED;
|
| + }
|
|
|
| int id = [BrowserWindowUtils getCommandId:event];
|
| - if (id == -1)
|
| + if (id == -1) {
|
| + LOG(ERROR) << " > not handled; no command id";
|
| return content::KeyboardEventProcessingResult::NOT_HANDLED;
|
| + }
|
|
|
| if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) {
|
| using Result = content::KeyboardEventProcessingResult;
|
| - return [BrowserWindowUtils handleKeyboardEvent:event.os_event
|
| - inWindow:window()]
|
| - ? Result::HANDLED
|
| - : Result::NOT_HANDLED;
|
| + bool result = [BrowserWindowUtils handleKeyboardEvent:event.os_event
|
| + inWindow:window()];
|
| + LOG(ERROR) << " > handleKeyboardEvent: returned " << result;
|
| + return result ? Result::HANDLED : Result::NOT_HANDLED;
|
| }
|
|
|
| + LOG(ERROR) << " > returning default";
|
| return content::KeyboardEventProcessingResult::NOT_HANDLED_IS_SHORTCUT;
|
| }
|
|
|
|
|