diff options
author | Alex Mineer <amineer@chromium.org> | 2015-03-04 14:41:06 -0800 |
---|---|---|
committer | Alex Mineer <amineer@chromium.org> | 2015-03-04 22:42:50 +0000 |
commit | de28ac5aa3543b6f6f749693a83d30f6572ec76b (patch) | |
tree | ec8123fdf414c3bf1279e4fc8fe1547091bc0e71 | |
parent | a310715cfacd8a71a8f072f801fce144073c8ac3 (diff) | |
download | chromium_src-de28ac5aa3543b6f6f749693a83d30f6572ec76b.zip chromium_src-de28ac5aa3543b6f6f749693a83d30f6572ec76b.tar.gz chromium_src-de28ac5aa3543b6f6f749693a83d30f6572ec76b.tar.bz2 |
Exit HTML Fullscreen when browser fullscreen is active.
Ensure web contents exit fullscreen state by sending a resize message, which includes the fullscreen state. This is required for the situation of the browser moving the view into a fullscreen state "browser fullscreen" and then the contents entering "tab fullscreen". Exiting the contents "tab fullscreen" then won't have the side effect of the view resizing, hence the explicit call here is required.
Fixes a regression caused in the refactoring
Fullscreen: make fullscreen requests come from RenderFrame
https://codereview.chromium.org/789533002
https://crrev.com/7a78d6fd7dc3241a91a614a09f9c59a0e4454135
where the previous implementation's call to WasResized in
RenderViewHostImpl::OnToggleFullscreen was not brought forward to
WebContentsImpl::ExitFullscreenMode().
BUG=458013
TEST=Open http://scheib.github.io/HTMLMisc/PointerLockAndFullscreen.html, enter Browser Fullscreen with F11 key, press Toggle Fullscreen button, press ESC key, expect content to exit fullscreen.
Review URL: https://codereview.chromium.org/928673002
(cherry picked from commit 3dcb6c931a974f4e825f5383e98ed5b958819b56)
Cr-Original-Commit-Position: refs/heads/master@{#317562}
Cr-Commit-Position: refs/branch-heads/2311@{#136}
Cr-Branched-From: 09b7de5dd7254947cd4306de907274fa63373d48-refs/heads/master@{#317474}
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index ed67922..e248fe0 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -1479,6 +1479,17 @@ void WebContentsImpl::ExitFullscreenMode() { if (delegate_) delegate_->ExitFullscreenModeForTab(this); + // Ensure web contents exit fullscreen state by sending a resize message, + // which includes the fullscreen state. This is required for the situation + // of the browser moving the view into a fullscreen state "browser fullscreen" + // and then the contents entering "tab fullscreen". Exiting the contents + // "tab fullscreen" then won't have the side effect of the view resizing, + // hence the explicit call here is required. + if (RenderWidgetHostView* rwh_view = GetRenderWidgetHostView()) { + if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) + render_widget_host->WasResized(); + } + FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); |