|
@@ -17,12 +17,12 @@
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
-void CommonWebContentsDelegate::HandleKeyboardEvent(
|
|
|
+bool CommonWebContentsDelegate::HandleKeyboardEvent(
|
|
|
content::WebContents* source,
|
|
|
const content::NativeWebKeyboardEvent& event) {
|
|
|
if (event.skip_in_browser ||
|
|
|
event.GetType() == content::NativeWebKeyboardEvent::kChar)
|
|
|
- return;
|
|
|
+ return false;
|
|
|
|
|
|
// Escape exits tabbed fullscreen mode.
|
|
|
if (event.windows_key_code == ui::VKEY_ESCAPE && is_html_fullscreen()) {
|
|
@@ -34,16 +34,23 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
|
|
|
auto* web_preferences = WebContentsPreferences::From(source);
|
|
|
if (web_preferences &&
|
|
|
web_preferences->IsEnabled("ignoreMenuShortcuts", false))
|
|
|
- return;
|
|
|
+ return false;
|
|
|
|
|
|
// Send the event to the menu before sending it to the window
|
|
|
if (event.os_event.type == NSKeyDown &&
|
|
|
[[NSApp mainMenu] performKeyEquivalent:event.os_event])
|
|
|
- return;
|
|
|
+ return true;
|
|
|
|
|
|
if (event.os_event.window &&
|
|
|
- [event.os_event.window isKindOfClass:[EventDispatchingWindow class]])
|
|
|
+ [event.os_event.window isKindOfClass:[EventDispatchingWindow class]]) {
|
|
|
[event.os_event.window redispatchKeyEvent:event.os_event];
|
|
|
+ // FIXME(nornagon): this isn't the right return value; we should implement
|
|
|
+ // devtools windows as Widgets in order to take advantage of the
|
|
|
+ // pre-existing redispatch code in bridged_native_widget.
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
} // namespace atom
|