From 28f10a09e5daddb2c378dede6031bf568c70a61f Mon Sep 17 00:00:00 2001 From: bridiver Date: Fri, 26 Aug 2016 15:29:39 -0700 Subject: [PATCH] exit tab fullscreen on escape and destroy auditors: @bbondy --- atom/browser/api/atom_api_web_contents.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index a444986083..605fcb8818 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -618,12 +618,8 @@ void WebContents::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { if (type_ == WEB_VIEW && embedder_) { - if (event.windowsKeyCode == ui::VKEY_ESCAPE) { - CommonWebContentsDelegate::HandleKeyboardEvent(source, event); - } else { - // Send the unhandled keyboard events back to the embedder. - embedder_->HandleKeyboardEvent(source, event); - } + // Send the unhandled keyboard events back to the embedder. + embedder_->HandleKeyboardEvent(source, event); } else { // Go to the default keyboard handling. CommonWebContentsDelegate::HandleKeyboardEvent(source, event); @@ -954,6 +950,8 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) { // be destroyed on close, and WebContentsDestroyed would be called for it, so // we need to make sure the api::WebContents is also deleted. void WebContents::WebContentsDestroyed() { + // clear our fullscreen state + ExitFullscreenModeForTab(web_contents()); // This event is only for internal use, which is emitted when WebContents is // being destroyed. Emit("will-destroy");