Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GTK] Remove WKFullScreenClientGtk
https://bugs.webkit.org/show_bug.cgi?id=173140

Reviewed by Michael Catanzaro.

It's only used internally in the GTK+ API. Implementation is a lot simpler without using it, we can simply use
either WebKitWebView or WebKitWebViewBase from PageClient directly.

* PlatformGTK.cmake:
* UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp: Removed.
* UIProcess/API/C/gtk/WKFullScreenClientGtk.h: Removed.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
* UIProcess/API/gtk/WebKitFullscreenClient.cpp: Removed.
* UIProcess/API/gtk/WebKitFullscreenClient.h: Removed.
* UIProcess/API/gtk/WebKitPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed):
(webkitWebViewEnterFullScreen):
(webkitWebViewExitFullScreen):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseEnterFullScreen):
(webkitWebViewBaseExitFullScreen):
(webkitWebViewBaseIsFullScreen):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/gtk/WebFullScreenClientGtk.cpp: Removed.
* UIProcess/gtk/WebFullScreenClientGtk.h: Removed.

Canonical link: https://commits.webkit.org/190076@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Jun 11, 2017
1 parent c8eea72 commit db66f7b
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 302 deletions.
33 changes: 33 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,36 @@
2017-06-10 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Remove WKFullScreenClientGtk
https://bugs.webkit.org/show_bug.cgi?id=173140

Reviewed by Michael Catanzaro.

It's only used internally in the GTK+ API. Implementation is a lot simpler without using it, we can simply use
either WebKitWebView or WebKitWebViewBase from PageClient directly.

* PlatformGTK.cmake:
* UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp: Removed.
* UIProcess/API/C/gtk/WKFullScreenClientGtk.h: Removed.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
* UIProcess/API/gtk/WebKitFullscreenClient.cpp: Removed.
* UIProcess/API/gtk/WebKitFullscreenClient.h: Removed.
* UIProcess/API/gtk/WebKitPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed):
(webkitWebViewEnterFullScreen):
(webkitWebViewExitFullScreen):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseEnterFullScreen):
(webkitWebViewBaseExitFullScreen):
(webkitWebViewBaseIsFullScreen):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/gtk/WebFullScreenClientGtk.cpp: Removed.
* UIProcess/gtk/WebFullScreenClientGtk.h: Removed.

2017-06-10 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Handle page download request in WebKitWebView directly
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit2/PlatformGTK.cmake
Expand Up @@ -109,7 +109,6 @@ list(APPEND WebKit2_SOURCES

UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp

UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp
UIProcess/API/C/gtk/WKInspectorClientGtk.cpp
UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
UIProcess/API/C/gtk/WKView.cpp
Expand Down Expand Up @@ -176,8 +175,6 @@ list(APPEND WebKit2_SOURCES
UIProcess/API/gtk/WebKitFormSubmissionRequest.h
UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h
UIProcess/API/gtk/WebKitForwardDeclarations.h
UIProcess/API/gtk/WebKitFullscreenClient.cpp
UIProcess/API/gtk/WebKitFullscreenClient.h
UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp
UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h
Expand Down Expand Up @@ -339,7 +336,6 @@ list(APPEND WebKit2_SOURCES
UIProcess/gtk/WaylandCompositor.cpp
UIProcess/gtk/WebColorPickerGtk.cpp
UIProcess/gtk/WebContextMenuProxyGtk.cpp
UIProcess/gtk/WebFullScreenClientGtk.cpp
UIProcess/gtk/WebInspectorClientGtk.cpp
UIProcess/gtk/WebInspectorProxyGtk.cpp
UIProcess/gtk/WebKitInspectorWindow.cpp
Expand Down
37 changes: 0 additions & 37 deletions Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp

This file was deleted.

56 changes: 0 additions & 56 deletions Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h

This file was deleted.

19 changes: 15 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Expand Up @@ -294,24 +294,35 @@ void PageClientImpl::closeFullScreenManager()

bool PageClientImpl::isFullScreen()
{
notImplemented();
return false;
return webkitWebViewBaseIsFullScreen(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
}

void PageClientImpl::enterFullScreen()
{
if (!m_viewWidget)
return;

webkitWebViewBaseEnterFullScreen(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
if (isFullScreen())
return;

if (WEBKIT_IS_WEB_VIEW(m_viewWidget))
webkitWebViewEnterFullScreen(WEBKIT_WEB_VIEW(m_viewWidget));
else
webkitWebViewBaseEnterFullScreen(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
}

void PageClientImpl::exitFullScreen()
{
if (!m_viewWidget)
return;

webkitWebViewBaseExitFullScreen(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
if (!isFullScreen())
return;

if (WEBKIT_IS_WEB_VIEW(m_viewWidget))
webkitWebViewExitFullScreen(WEBKIT_WEB_VIEW(m_viewWidget));
else
webkitWebViewBaseExitFullScreen(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
}

void PageClientImpl::beganEnterFullScreen(const IntRect& /* initialFrame */, const IntRect& /* finalFrame */)
Expand Down
50 changes: 0 additions & 50 deletions Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.h

This file was deleted.

1 change: 0 additions & 1 deletion Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
Expand Up @@ -30,7 +30,6 @@
#include <WebKit/WKAPICast.h>
#include <WebKit/WKDownload.h>
#include <WebKit/WKFindOptions.h>
#include <WebKit/WKFullScreenClientGtk.h>
#include <WebKit/WKGeolocationManager.h>
#include <WebKit/WKGeolocationPermissionRequest.h>
#include <WebKit/WKGeolocationPosition.h>
Expand Down
16 changes: 10 additions & 6 deletions Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Expand Up @@ -40,7 +40,6 @@
#include "WebKitError.h"
#include "WebKitFaviconDatabasePrivate.h"
#include "WebKitFormClient.h"
#include "WebKitFullscreenClient.h"
#include "WebKitHitTestResultPrivate.h"
#include "WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h"
#include "WebKitJavascriptResultPrivate.h"
Expand Down Expand Up @@ -692,7 +691,6 @@ static void webkitWebViewConstructed(GObject* object)
attachLoaderClientToView(webView);
attachUIClientToView(webView);
attachPolicyClientToView(webView);
attachFullScreenClientToView(webView);
attachContextMenuClientToView(webView);
attachFormClientToView(webView);

Expand Down Expand Up @@ -2079,18 +2077,24 @@ void webkitWebViewRemoveLoadingWebResource(WebKitWebView* webView, uint64_t reso
priv->loadingResourcesMap.remove(resourceIdentifier);
}

bool webkitWebViewEnterFullScreen(WebKitWebView* webView)
void webkitWebViewEnterFullScreen(WebKitWebView* webView)
{
#if ENABLE(FULLSCREEN_API)
gboolean returnValue;
g_signal_emit(webView, signals[ENTER_FULLSCREEN], 0, &returnValue);
return !returnValue;
if (!returnValue)
webkitWebViewBaseEnterFullScreen(WEBKIT_WEB_VIEW_BASE(webView));
#endif
}

bool webkitWebViewLeaveFullScreen(WebKitWebView* webView)
void webkitWebViewExitFullScreen(WebKitWebView* webView)
{
#if ENABLE(FULLSCREEN_API)
gboolean returnValue;
g_signal_emit(webView, signals[LEAVE_FULLSCREEN], 0, &returnValue);
return !returnValue;
if (!returnValue)
webkitWebViewBaseExitFullScreen(WEBKIT_WEB_VIEW_BASE(webView));
#endif
}

void webkitWebViewRunFileChooserRequest(WebKitWebView* webView, WebKitFileChooserRequest* request)
Expand Down
22 changes: 8 additions & 14 deletions Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
Expand Up @@ -40,7 +40,6 @@
#include "NativeWebWheelEvent.h"
#include "PageClientImpl.h"
#include "WebEventFactory.h"
#include "WebFullScreenClientGtk.h"
#include "WebInspectorProxy.h"
#include "WebKit2Initialize.h"
#include "WebKitAuthenticationDialog.h"
Expand Down Expand Up @@ -191,7 +190,6 @@ struct _WebKitWebViewBasePrivate {

#if ENABLE(FULLSCREEN_API)
bool fullScreenModeActive { false };
WebFullScreenClientGtk fullScreenClient;
GRefPtr<GDBusProxy> screenSaverProxy;
GRefPtr<GCancellable> screenSaverInhibitCancellable;
unsigned screenSaverCookie { 0 };
Expand Down Expand Up @@ -1322,11 +1320,7 @@ void webkitWebViewBaseEnterFullScreen(WebKitWebViewBase* webkitWebViewBase)
{
#if ENABLE(FULLSCREEN_API)
WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
if (priv->fullScreenModeActive)
return;

if (!priv->fullScreenClient.willEnterFullScreen())
return;
ASSERT(priv->fullScreenModeActive);

WebFullScreenManagerProxy* fullScreenManagerProxy = priv->pageProxy->fullScreenManager();
fullScreenManagerProxy->willEnterFullScreen();
Expand All @@ -1344,11 +1338,7 @@ void webkitWebViewBaseExitFullScreen(WebKitWebViewBase* webkitWebViewBase)
{
#if ENABLE(FULLSCREEN_API)
WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
if (!priv->fullScreenModeActive)
return;

if (!priv->fullScreenClient.willExitFullScreen())
return;
ASSERT(!priv->fullScreenModeActive);

WebFullScreenManagerProxy* fullScreenManagerProxy = priv->pageProxy->fullScreenManager();
fullScreenManagerProxy->willExitFullScreen();
Expand All @@ -1362,9 +1352,13 @@ void webkitWebViewBaseExitFullScreen(WebKitWebViewBase* webkitWebViewBase)
#endif
}

void webkitWebViewBaseInitializeFullScreenClient(WebKitWebViewBase* webkitWebViewBase, const WKFullScreenClientGtkBase* wkClient)
bool webkitWebViewBaseIsFullScreen(WebKitWebViewBase* webkitWebViewBase)
{
webkitWebViewBase->priv->fullScreenClient.initialize(wkClient);
#if ENABLE(FULLSCREEN_API)
return webkitWebViewBase->priv->fullScreenModeActive;
#else
return false;
#endif
}

void webkitWebViewBaseSetInspectorViewSize(WebKitWebViewBase* webkitWebViewBase, unsigned size)
Expand Down
Expand Up @@ -48,7 +48,7 @@ void webkitWebViewBaseForwardNextWheelEvent(WebKitWebViewBase*);
void webkitWebViewBaseChildMoveResize(WebKitWebViewBase*, GtkWidget*, const WebCore::IntRect&);
void webkitWebViewBaseEnterFullScreen(WebKitWebViewBase*);
void webkitWebViewBaseExitFullScreen(WebKitWebViewBase*);
void webkitWebViewBaseInitializeFullScreenClient(WebKitWebViewBase*, const WKFullScreenClientGtkBase*);
bool webkitWebViewBaseIsFullScreen(WebKitWebViewBase*);
void webkitWebViewBaseSetInspectorViewSize(WebKitWebViewBase*, unsigned size);
void webkitWebViewBaseSetActiveContextMenuProxy(WebKitWebViewBase*, WebKit::WebContextMenuProxyGtk*);
WebKit::WebContextMenuProxyGtk* webkitWebViewBaseGetActiveContextMenuProxy(WebKitWebViewBase*);
Expand Down

0 comments on commit db66f7b

Please sign in to comment.