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 4f90143f55dfc95e943d980471fbb406fcd2b98c..5701e3392ea08d516ece375ced2a48aee2055052 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())); |