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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 789533002: Fullscreen: make fullscreen requests come from RenderFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index bd37a3cbb05e221e57d090cad2642c1a0d5d627b..4021310dbc8966fd7dde5652b32903160989d5f3 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -893,7 +893,6 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove)
IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame,
OnDocumentAvailableInMainFrame)
- IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen, OnToggleFullscreen)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
OnDidContentsPreferredSizeChange)
IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent,
@@ -1122,11 +1121,24 @@ void RenderViewHostImpl::OnDocumentAvailableInMainFrame(
host_zoom_map->GetDefaultZoomLevel());
}
-void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
+void RenderViewHostImpl::EnterFullscreen(const GURL& origin) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- delegate_->ToggleFullscreenMode(enter_fullscreen);
- // We need to notify the contents that its fullscreen state has changed. This
- // is done as part of the resize message.
+
+ delegate_->EnterFullscreenMode(origin);
+
+ // The previous call might change the fullscreen state. We need to make sure
+ // the renderer is aware of that, which is done via the resize message.
+ WasResized();
+}
+
+void RenderViewHostImpl::ExitFullscreen() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ RejectMouseLockOrUnlockIfNecessary();
+ delegate_->ExitFullscreenMode();
+
+ // The previous call might change the fullscreen state. We need to make sure
+ // the renderer is aware of that, which is done via the resize message.
WasResized();
}
@@ -1336,12 +1348,6 @@ void RenderViewHostImpl::OnTextSurroundingSelectionResponse(
view_->OnTextSurroundingSelectionResponse(content, start_offset, end_offset);
}
-void RenderViewHostImpl::ExitFullscreen() {
- RejectMouseLockOrUnlockIfNecessary();
- // Notify delegate_ and renderer of fullscreen state change.
- OnToggleFullscreen(false);
-}
-
WebPreferences RenderViewHostImpl::GetWebkitPreferences() {
if (!web_preferences_.get()) {
OnWebkitPreferencesChanged();

Powered by Google App Engine
This is Rietveld 408576698