Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2916)

Unified Diff: chrome/browser/ui/exclusive_access/fullscreen_controller.cc

Issue 1488653002: Fix scroll restoration when exiting fullscreen mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/exclusive_access/fullscreen_controller.cc
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
index 3c7018ccf49f8d54c38ee112054071ec6037fc46..ed68d08bd5e78207cb9868c690367f266dfa15c1 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
@@ -25,6 +25,7 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
@@ -37,6 +38,8 @@
using base::UserMetricsAction;
using content::RenderViewHost;
+using content::RenderWidgetHost;
+using content::RenderWidgetHostView;
using content::WebContents;
FullscreenController::FullscreenController(ExclusiveAccessManager* manager)
@@ -218,6 +221,17 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
// This is only a change between Browser and Tab fullscreen. We generate
// a fullscreen notification now because there is no window change.
PostFullscreenChangeNotification(true);
+
+ // Ensure web contents exit fullscreen state by sending a resize message,
scheib 2015/12/01 00:30:18 I'm a bit wondering why this isn't part of ::Notif
bokan 2015/12/01 20:46:10 I rarely dwell in these parts so it's entirely lik
+ // 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* rwhv = web_contents->GetRenderWidgetHostView()) {
+ if (RenderWidgetHost* render_widget_host = rwhv->GetRenderWidgetHost())
+ render_widget_host->WasResized();
+ }
}
#if defined(OS_WIN)

Powered by Google App Engine
This is Rietveld 408576698