| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index fe78dfd32e117af01f3dfb0c4323bbd828627860..8a0514824e83c319b71bbe6938a4f8ee5fcc3dec 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -1669,11 +1669,13 @@ void WebContentsImpl::EnterFullscreenMode(const GURL& origin) {
|
| delegate_->EnterFullscreenModeForTab(this, origin);
|
|
|
| FOR_EACH_OBSERVER(WebContentsObserver, observers_,
|
| - DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab(
|
| - GetRenderViewHost()->GetWidget())));
|
| + DidToggleFullscreenModeForTab(
|
| + IsFullscreenForCurrentTab(
|
| + GetRenderViewHost()->GetWidget()),
|
| + false));
|
| }
|
|
|
| -void WebContentsImpl::ExitFullscreenMode() {
|
| +void WebContentsImpl::ExitFullscreenMode(bool will_cause_resize) {
|
| // This method is being called to leave renderer-initiated fullscreen mode.
|
| // Make sure any existing fullscreen widget is shut down first.
|
| RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView();
|
| @@ -1695,14 +1697,18 @@ void WebContentsImpl::ExitFullscreenMode() {
|
| // 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();
|
| + if (!will_cause_resize) {
|
| + if (RenderWidgetHostView* rwhv = GetRenderWidgetHostView()) {
|
| + if (RenderWidgetHost* render_widget_host = rwhv->GetRenderWidgetHost())
|
| + render_widget_host->WasResized();
|
| + }
|
| }
|
|
|
| FOR_EACH_OBSERVER(WebContentsObserver, observers_,
|
| - DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab(
|
| - GetRenderViewHost()->GetWidget())));
|
| + DidToggleFullscreenModeForTab(
|
| + IsFullscreenForCurrentTab(
|
| + GetRenderViewHost()->GetWidget()),
|
| + will_cause_resize));
|
| }
|
|
|
| bool WebContentsImpl::IsFullscreenForCurrentTab(
|
| @@ -2875,10 +2881,10 @@ void WebContentsImpl::HasManifest(const HasManifestCallback& callback) {
|
| manifest_manager_host_->HasManifest(GetMainFrame(), callback);
|
| }
|
|
|
| -void WebContentsImpl::ExitFullscreen() {
|
| +void WebContentsImpl::ExitFullscreen(bool will_cause_resize) {
|
| // Clean up related state and initiate the fullscreen exit.
|
| GetRenderViewHost()->GetWidget()->RejectMouseLockOrUnlockIfNecessary();
|
| - ExitFullscreenMode();
|
| + ExitFullscreenMode(will_cause_resize);
|
| }
|
|
|
| void WebContentsImpl::ResumeLoadingCreatedWebContents() {
|
| @@ -3059,7 +3065,7 @@ void WebContentsImpl::DidNavigateMainFramePreCommit(
|
| return;
|
| }
|
| if (IsFullscreenForCurrentTab(GetRenderViewHost()->GetWidget()))
|
| - ExitFullscreen();
|
| + ExitFullscreen(false);
|
| DCHECK(!IsFullscreenForCurrentTab(GetRenderViewHost()->GetWidget()));
|
| }
|
|
|
| @@ -3970,7 +3976,7 @@ void WebContentsImpl::RenderViewTerminated(RenderViewHost* rvh,
|
| // Ensure fullscreen mode is exited in the |delegate_| since a crashed
|
| // renderer may not have made a clean exit.
|
| if (IsFullscreenForCurrentTab(GetRenderViewHost()->GetWidget()))
|
| - ExitFullscreenMode();
|
| + ExitFullscreenMode(false);
|
|
|
| // Cancel any visible dialogs so they are not left dangling over the sad tab.
|
| CancelActiveAndPendingDialogs();
|
|
|