webContents: exit tabbed fullscreen when esc key is pressed
This commit is contained in:
parent
37044f6fd4
commit
1518ff6d22
2 changed files with 6 additions and 1 deletions
|
@ -277,7 +277,10 @@ bool WebContents::IsPopupOrPanel(const content::WebContents* source) const {
|
||||||
void WebContents::HandleKeyboardEvent(
|
void WebContents::HandleKeyboardEvent(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const content::NativeWebKeyboardEvent& event) {
|
const content::NativeWebKeyboardEvent& event) {
|
||||||
if (type_ == BROWSER_WINDOW) {
|
if (event.windowsKeyCode == ui::VKEY_ESCAPE && is_html_fullscreen()) {
|
||||||
|
// Escape exits tabbed fullscreen mode.
|
||||||
|
ExitFullscreenModeForTab(source);
|
||||||
|
} else if (type_ == BROWSER_WINDOW) {
|
||||||
owner_window()->HandleKeyboardEvent(source, event);
|
owner_window()->HandleKeyboardEvent(source, event);
|
||||||
} else if (type_ == WEB_VIEW && guest_delegate_) {
|
} else if (type_ == WEB_VIEW && guest_delegate_) {
|
||||||
// Send the unhandled keyboard events back to the embedder.
|
// Send the unhandled keyboard events back to the embedder.
|
||||||
|
|
|
@ -48,6 +48,8 @@ class CommonWebContentsDelegate
|
||||||
|
|
||||||
NativeWindow* owner_window() const { return owner_window_.get(); }
|
NativeWindow* owner_window() const { return owner_window_.get(); }
|
||||||
|
|
||||||
|
bool is_html_fullscreen() const { return html_fullscreen_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// content::WebContentsDelegate:
|
// content::WebContentsDelegate:
|
||||||
content::WebContents* OpenURLFromTab(
|
content::WebContents* OpenURLFromTab(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue