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

Unified Diff: Source/web/FullscreenController.cpp

Issue 790543003: Add enterFullscreen/exitFullscreen to WebFrameClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.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
« no previous file with comments | « no previous file | public/web/WebFrameClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/FullscreenController.cpp
diff --git a/Source/web/FullscreenController.cpp b/Source/web/FullscreenController.cpp
index f6831f51c35b8cd8bb9d7af973715da577dade1a..3c149a94dbe07f9edfd1a3ccac53040c5d242b29 100644
--- a/Source/web/FullscreenController.cpp
+++ b/Source/web/FullscreenController.cpp
@@ -38,8 +38,9 @@
#include "core/html/HTMLVideoElement.h"
#include "platform/LayoutTestSupport.h"
#include "platform/RuntimeEnabledFeatures.h"
-#include "public/web/WebFrame.h"
+#include "public/web/WebFrameClient.h"
#include "public/web/WebViewClient.h"
+#include "web/WebLocalFrameImpl.h"
#include "web/WebSettingsImpl.h"
#include "web/WebViewImpl.h"
@@ -146,7 +147,12 @@ void FullscreenController::enterFullScreenForElement(Element* element)
}
// We need to transition to fullscreen mode.
- if (WebViewClient* client = m_webViewImpl->client()) {
+ // FIXME: temporarily try to use WebFrameClient and WebViewClient while
+ // Chromium switches from one to the other, see https://crbug.com/374854
+ WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(element->document().frame());
+ if (frame && frame->client() && frame->client()->enterFullscreen()) {
+ m_provisionalFullScreenElement = element;
+ } else if (WebViewClient* client = m_webViewImpl->client()) {
if (client->enterFullScreen())
m_provisionalFullScreenElement = element;
}
@@ -157,6 +163,13 @@ void FullscreenController::exitFullScreenForElement(Element* element)
// The client is exiting full screen, so don't send a notification.
if (m_isCancelingFullScreen)
return;
+
+ // FIXME: temporarily try to use WebFrameClient and WebViewClient while
+ // Chromium switches from one to the other, see https://crbug.com/374854
+ WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(element->document().frame());
+ if (frame && frame->client() && frame->client()->exitFullscreen())
+ return;
+
if (WebViewClient* client = m_webViewImpl->client())
client->exitFullScreen();
}
« no previous file with comments | « no previous file | public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698