Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
exit tab fullscreen on escape and destroy
Browse files Browse the repository at this point in the history
auditors: @bbondy
  • Loading branch information
bridiver committed Sep 16, 2016
1 parent 0e574b0 commit 28f10a0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 28f10a0

Please sign in to comment.