From fcd089040ce6a3860ab4abccc6f56afcd99baeed Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Tue, 26 Nov 2013 11:22:02 +0100 Subject: Implement requestFullscreen for QQuickWebEngineView. This patch adds a property isFullScreen and a signal fullScreenRequested to QQuickWebEngineViewExperimental. The signal fullScreenRequested is emitted when some web content requests fullscreen through the javascript API. The property isFullScreen is supposed to be set programmatically when the view is being shown fullscreen. This information is then available to the WebContentsDelegateQt when checking if the fullscreen request has been accepted. Change-Id: I04cbb45f263a188d26cc87d70ac53b0fbab63936 Reviewed-by: Jocelyn Turcotte --- src/core/web_contents_delegate_qt.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/web_contents_delegate_qt.cpp') diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 232bb95ef..16ec54afd 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -133,6 +133,19 @@ content::JavaScriptDialogManager *WebContentsDelegateQt::GetJavaScriptDialogMana return JavaScriptDialogManagerQt::GetInstance(); } +void WebContentsDelegateQt::ToggleFullscreenModeForTab(content::WebContents* web_contents, bool enter_fullscreen) +{ + if (m_viewClient->isFullScreen() != enter_fullscreen) { + m_viewClient->requestFullScreen(enter_fullscreen); + web_contents->GetRenderViewHost()->WasResized(); + } +} + +bool WebContentsDelegateQt::IsFullscreenForTabOrPending(const content::WebContents* web_contents) const +{ + return m_viewClient->isFullScreen(); +} + Q_STATIC_ASSERT_X(static_cast(WebContentsAdapterClient::Open) == static_cast(content::FileChooserParams::Open), "Enums out of sync"); Q_STATIC_ASSERT_X(static_cast(WebContentsAdapterClient::Save) == static_cast(content::FileChooserParams::Save), "Enums out of sync"); -- cgit v1.2.3