fix: return after handling Esc for fullscreen in WebContentsDelegate (#16342)

This commit is contained in:
Jeremy Apthorp 2019-01-10 08:03:48 -08:00 committed by John Kleinschmidt
parent 0299328521
commit 782825fc29
2 changed files with 6 additions and 2 deletions

View file

@ -25,8 +25,10 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
return;
// Escape exits tabbed fullscreen mode.
if (event.windows_key_code == ui::VKEY_ESCAPE && is_html_fullscreen())
if (event.windows_key_code == ui::VKEY_ESCAPE && is_html_fullscreen()) {
ExitFullscreenModeForTab(source);
return;
}
// Check if the webContents has preferences and to ignore shortcuts
auto* web_preferences = WebContentsPreferences::From(source);

View file

@ -21,8 +21,10 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
// Escape exits tabbed fullscreen mode.
if (event.windows_key_code == ui::VKEY_ESCAPE && is_html_fullscreen())
if (event.windows_key_code == ui::VKEY_ESCAPE && is_html_fullscreen()) {
ExitFullscreenModeForTab(source);
return;
}
// Check if the webContents has preferences and to ignore shortcuts
auto* web_preferences = WebContentsPreferences::From(source);