Title: [160296] trunk/Source/WebKit2
Revision
160296
Author
wei...@apple.com
Date
2013-12-08 20:11:00 -0800 (Sun, 08 Dec 2013)

Log Message

[Cocoa] Remove knowledge of the WKView from the WebFullScreenManagerProxy by adding a proper client
https://bugs.webkit.org/show_bug.cgi?id=125427

Reviewed by Dan Bernstein.

* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::fullScreenManagerProxyClient):
(WebKit::PageClientImpl::closeFullScreenManager):
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
(WebKit::PageClientImpl::beganEnterFullScreen):
(WebKit::PageClientImpl::beganExitFullScreen):
Implement the new client.

* UIProcess/API/mac/WKView.mm:
Remove call to setWebView() and do some cleanup.

* UIProcess/API/mac/WKViewInternal.h:
Convert to property syntax and re-arrange.

* UIProcess/PageClient.h:
Expose access to the new client.

* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::create):
(WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
(WebKit::WebFullScreenManagerProxy::invalidate):
(WebKit::WebFullScreenManagerProxy::close):
(WebKit::WebFullScreenManagerProxy::isFullScreen):
(WebKit::WebFullScreenManagerProxy::enterFullScreen):
(WebKit::WebFullScreenManagerProxy::exitFullScreen):
(WebKit::WebFullScreenManagerProxy::beganEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::beganExitFullScreen):
* UIProcess/WebFullScreenManagerProxy.h:
Use the new client.

* UIProcess/WebPageProxy.cpp:
Pass the new client.

* UIProcess/mac/WebFullScreenManagerProxyMac.mm:
Removed. Now goes through the client.

* WebKit2.xcodeproj/project.pbxproj:
Remove WebFullScreenManagerProxyMac.mm.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (160295 => 160296)


--- trunk/Source/WebKit2/ChangeLog	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/ChangeLog	2013-12-09 04:11:00 UTC (rev 160296)
@@ -1,3 +1,52 @@
+2013-12-08  Sam Weinig  <s...@webkit.org>
+
+        [Cocoa] Remove knowledge of the WKView from the WebFullScreenManagerProxy by adding a proper client
+        https://bugs.webkit.org/show_bug.cgi?id=125427
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::fullScreenManagerProxyClient):
+        (WebKit::PageClientImpl::closeFullScreenManager):
+        (WebKit::PageClientImpl::isFullScreen):
+        (WebKit::PageClientImpl::enterFullScreen):
+        (WebKit::PageClientImpl::exitFullScreen):
+        (WebKit::PageClientImpl::beganEnterFullScreen):
+        (WebKit::PageClientImpl::beganExitFullScreen):
+        Implement the new client.
+
+        * UIProcess/API/mac/WKView.mm:
+        Remove call to setWebView() and do some cleanup.
+
+        * UIProcess/API/mac/WKViewInternal.h:
+        Convert to property syntax and re-arrange.
+
+        * UIProcess/PageClient.h:
+        Expose access to the new client.
+
+        * UIProcess/WebFullScreenManagerProxy.cpp:
+        (WebKit::WebFullScreenManagerProxy::create):
+        (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
+        (WebKit::WebFullScreenManagerProxy::invalidate):
+        (WebKit::WebFullScreenManagerProxy::close):
+        (WebKit::WebFullScreenManagerProxy::isFullScreen):
+        (WebKit::WebFullScreenManagerProxy::enterFullScreen):
+        (WebKit::WebFullScreenManagerProxy::exitFullScreen):
+        (WebKit::WebFullScreenManagerProxy::beganEnterFullScreen):
+        (WebKit::WebFullScreenManagerProxy::beganExitFullScreen):
+        * UIProcess/WebFullScreenManagerProxy.h:
+        Use the new client.
+
+        * UIProcess/WebPageProxy.cpp:
+        Pass the new client.
+
+        * UIProcess/mac/WebFullScreenManagerProxyMac.mm:
+        Removed. Now goes through the client.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Remove WebFullScreenManagerProxyMac.mm.
+
 2013-12-07  Sam Weinig  <s...@webkit.org>
 
         [Cocoa] Remove webProcessPlugInInitialize: from the WKWebProcessPlugIn protocol

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h	2013-12-09 04:11:00 UTC (rev 160296)
@@ -28,6 +28,7 @@
 
 #include "CorrectionPanel.h"
 #include "PageClient.h"
+#include "WebFullScreenManagerProxy.h"
 #include <wtf/RetainPtr.h>
 
 @class WKEditorUndoTargetObjC;
@@ -40,14 +41,19 @@
 namespace WebKit {
 class FindIndicatorWindow;
 
-class PageClientImpl FINAL : public PageClient {
+class PageClientImpl FINAL : public PageClient
+#if ENABLE(FULLSCREEN_API)
+    , public WebFullScreenManagerProxyClient
+#endif
+    {
 public:
-    explicit PageClientImpl(WKView*);
+    explicit PageClientImpl(WKView *);
     virtual ~PageClientImpl();
     
     void viewWillMoveToAnotherWindow();
 
 private:
+    // PageClient
     virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy();
     virtual void setViewNeedsDisplay(const WebCore::IntRect&);
     virtual void displayView();
@@ -134,6 +140,21 @@
     virtual Vector<String> dictationAlternatives(uint64_t dictationContext);
 #endif
 
+    // Auxiliary Client Creation
+#if ENABLE(FULLSCREEN_API)
+    WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() OVERRIDE;
+#endif
+
+#if ENABLE(FULLSCREEN_API)
+    // WebFullScreenManagerProxyClient
+    virtual void closeFullScreenManager() OVERRIDE;
+    virtual bool isFullScreen() OVERRIDE;
+    virtual void enterFullScreen() OVERRIDE;
+    virtual void exitFullScreen() OVERRIDE;
+    virtual void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) OVERRIDE;
+    virtual void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) OVERRIDE;
+#endif
+
     WKView* m_wkView;
     RetainPtr<WKEditorUndoTargetObjC> m_undoTarget;
 #if USE(AUTOCORRECTION_PANEL)

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm	2013-12-09 04:11:00 UTC (rev 160296)
@@ -26,20 +26,17 @@
 #import "config.h"
 #import "PageClientImpl.h"
 
-#if USE(DICTATION_ALTERNATIVES)
-#import <AppKit/NSTextAlternatives.h>
-#endif
 #import "AttributedString.h"
 #import "ColorSpaceData.h"
 #import "DataReference.h"
 #import "DictionaryPopupInfo.h"
 #import "FindIndicator.h"
 #import "NativeWebKeyboardEvent.h"
+#import "StringUtilities.h"
 #import "WKAPICast.h"
+#import "WKFullScreenWindowController.h"
 #import "WKStringCF.h"
 #import "WKViewInternal.h"
-#import "WKViewPrivate.h"
-#import "StringUtilities.h"
 #import "WebColorPickerMac.h"
 #import "WebContextMenuProxyMac.h"
 #import "WebEditCommandProxy.h"
@@ -53,10 +50,14 @@
 #import <WebCore/KeyboardEvent.h>
 #import <WebCore/NotImplemented.h>
 #import <WebCore/SharedBuffer.h>
+#import <WebKitSystemInterface.h>
 #import <wtf/text/CString.h>
 #import <wtf/text/WTFString.h>
-#import <WebKitSystemInterface.h>
 
+#if USE(DICTATION_ALTERNATIVES)
+#import <AppKit/NSTextAlternatives.h>
+#endif
+
 @interface NSApplication (WebNSApplicationDetails)
 - (NSCursor *)_cursorRectCursor;
 @end
@@ -554,4 +555,48 @@
 }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+
+WebFullScreenManagerProxyClient& PageClientImpl::fullScreenManagerProxyClient()
+{
+    return *this;
+}
+
+// WebFullScreenManagerProxyClient
+
+void PageClientImpl::closeFullScreenManager()
+{
+    [m_wkView _closeFullScreenWindowController];
+}
+
+bool PageClientImpl::isFullScreen()
+{
+    if (!m_wkView._hasFullScreenWindowController)
+        return false;
+
+    return m_wkView._fullScreenWindowController.isFullScreen;
+}
+
+void PageClientImpl::enterFullScreen()
+{
+    [m_wkView._fullScreenWindowController enterFullScreen:nil];
+}
+
+void PageClientImpl::exitFullScreen()
+{
+    [m_wkView._fullScreenWindowController exitFullScreen];
+}
+
+void PageClientImpl::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
+{
+    [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
+}
+
+void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
+{
+    [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
+}
+
+#endif // ENABLE(FULLSCREEN_API)
+
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-12-09 04:11:00 UTC (rev 160296)
@@ -58,7 +58,6 @@
 #import "WKViewPrivate.h"
 #import "WebContext.h"
 #import "WebEventFactory.h"
-#import "WebFullScreenManagerProxy.h"
 #import "WebKit2Initialize.h"
 #import "WebPage.h"
 #import "WebPageGroup.h"
@@ -75,6 +74,7 @@
 #import <WebCore/FloatRect.h>
 #import <WebCore/Image.h>
 #import <WebCore/IntRect.h>
+#import <WebCore/FileSystem.h>
 #import <WebCore/KeyboardEvent.h>
 #import <WebCore/LocalizedStrings.h>
 #import <WebCore/PlatformEventFactoryMac.h>
@@ -82,10 +82,9 @@
 #import <WebCore/Region.h>
 #import <WebCore/SharedBuffer.h>
 #import <WebCore/TextAlternativeWithRange.h>
-#import <WebCore/WebCoreNSStringExtras.h>
 #import <WebCore/WebCoreFullScreenPlaceholderView.h>
 #import <WebCore/WebCoreFullScreenWindow.h>
-#import <WebCore/FileSystem.h>
+#import <WebCore/WebCoreNSStringExtras.h>
 #import <WebKitSystemInterface.h>
 #import <sys/stat.h>
 #import <wtf/RefPtr.h>
@@ -2782,12 +2781,12 @@
 }
 
 #if ENABLE(FULLSCREEN_API)
-- (BOOL)hasFullScreenWindowController
+- (BOOL)_hasFullScreenWindowController
 {
     return (bool)_data->_fullScreenWindowController;
 }
 
-- (WKFullScreenWindowController*)fullScreenWindowController
+- (WKFullScreenWindowController *)_fullScreenWindowController
 {
     if (!_data->_fullScreenWindowController)
         _data->_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:[self createFullScreenWindow] webView:self]);
@@ -2795,11 +2794,12 @@
     return _data->_fullScreenWindowController.get();
 }
 
-- (void)closeFullScreenWindowController
+- (void)_closeFullScreenWindowController
 {
     if (!_data->_fullScreenWindowController)
         return;
-    [_data->_fullScreenWindowController.get() close];
+
+    [_data->_fullScreenWindowController close];
     _data->_fullScreenWindowController = nullptr;
 }
 #endif
@@ -2911,9 +2911,7 @@
     _data->_page = toImpl(contextRef)->createWebPage(*_data->_pageClient, toImpl(pageGroupRef), toImpl(relatedPage));
     _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
     _data->_page->initializeWebPage();
-#if ENABLE(FULLSCREEN_API)
-    _data->_page->fullScreenManager()->setWebView(self);
-#endif
+
     _data->_mouseDownEvent = nil;
     _data->_ignoringMouseDraggedEvents = NO;
     _data->_clipsToVisibleRect = NO;
@@ -3122,7 +3120,7 @@
     _data->_page->setUnderlayColor(colorFromNSColor(underlayColor));
 }
 
-- (NSView*)fullScreenPlaceholderView
+- (NSView *)fullScreenPlaceholderView
 {
 #if ENABLE(FULLSCREEN_API)
     if (_data->_fullScreenWindowController && [_data->_fullScreenWindowController isFullScreen])
@@ -3131,6 +3129,20 @@
     return nil;
 }
 
+- (NSWindow *)createFullScreenWindow
+{
+#if ENABLE(FULLSCREEN_API)
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1080
+    NSRect contentRect = NSZeroRect;
+#else
+    NSRect contentRect = [[NSScreen mainScreen] frame];
+#endif
+    return [[[WebCoreFullScreenWindow alloc] initWithContentRect:contentRect styleMask:(NSBorderlessWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO] autorelease];
+#else
+    return nil;
+#endif
+}
+
 - (void)beginDeferringViewInWindowChanges
 {
     if (_data->_shouldDeferViewInWindowChanges) {
@@ -3230,20 +3242,6 @@
     }
 }
 
-- (NSWindow*)createFullScreenWindow
-{
-#if ENABLE(FULLSCREEN_API)
-#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1080
-    NSRect contentRect = NSZeroRect;
-#else
-    NSRect contentRect = [[NSScreen mainScreen] frame];
-#endif
-    return [[[WebCoreFullScreenWindow alloc] initWithContentRect:contentRect styleMask:(NSBorderlessWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO] autorelease];
-#else
-    return nil;
-#endif
-}
-
 - (BOOL)isUsingUISideCompositing
 {
     if (DrawingAreaProxy* drawingArea = _data->_page->drawingArea())

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2013-12-09 04:11:00 UTC (rev 160296)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKView.h"
+#import "WKViewPrivate.h"
 
 #import "PluginComplexTextInputState.h"
 #import "WebFindOptions.h"
@@ -83,12 +83,6 @@
 
 - (WebKit::ColorSpaceData)_colorSpace;
 
-#if ENABLE(FULLSCREEN_API)
-- (BOOL)hasFullScreenWindowController;
-- (WKFullScreenWindowController*)fullScreenWindowController;
-- (void)closeFullScreenWindowController;
-#endif
-
 - (void)_cacheWindowBottomCornerRect;
 
 - (NSInteger)spellCheckerDocumentTag;
@@ -97,4 +91,10 @@
 - (void)_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates;
 - (BOOL)_suppressVisibilityUpdates;
 
+// FullScreen
+
+@property (readonly) BOOL _hasFullScreenWindowController;
+@property (readonly) WKFullScreenWindowController *_fullScreenWindowController;
+- (void)_closeFullScreenWindowController;
+
 @end

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2013-12-09 04:11:00 UTC (rev 160296)
@@ -43,11 +43,7 @@
 OBJC_CLASS WKView;
 OBJC_CLASS NSTextAlternatives;
 #endif
-
-#if PLATFORM(IOS)
-OBJC_CLASS UIWKView;
 #endif
-#endif
 
 namespace WebCore {
     class Cursor;
@@ -59,16 +55,22 @@
 class DrawingAreaProxy;
 class FindIndicator;
 class NativeWebKeyboardEvent;
+class WebContextMenuProxy;
+class WebEditCommandProxy;
+class WebPopupMenuProxy;
+
 #if ENABLE(TOUCH_EVENTS)
 class NativeWebTouchEvent;
 #endif
-class WebContextMenuProxy;
-class WebEditCommandProxy;
-class WebPopupMenuProxy;
+
 #if ENABLE(INPUT_TYPE_COLOR)
 class WebColorPicker;
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+class WebFullScreenManagerProxyClient;
+#endif
+
 #if PLATFORM(MAC)
 struct ColorSpaceData;
 #endif
@@ -242,6 +244,11 @@
     virtual void selectionDidChange() = 0;
     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0;
 #endif
+
+    // Auxiliary Client Creation
+#if ENABLE(FULLSCREEN_API)
+    virtual WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() = 0;
+#endif
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp	2013-12-09 04:11:00 UTC (rev 160296)
@@ -28,20 +28,24 @@
 
 #if ENABLE(FULLSCREEN_API)
 
-#include "WebContext.h"
 #include "WebFullScreenManagerMessages.h"
 #include "WebFullScreenManagerProxyMessages.h"
+#include "WebPageProxy.h"
+#include "WebProcessProxy.h"
+#include <WebCore/IntRect.h>
 
+using namespace WebCore;
+
 namespace WebKit {
 
-PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy* page)
+PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
 {
-    return adoptRef(new WebFullScreenManagerProxy(page));
+    return adoptRef(new WebFullScreenManagerProxy(page, client));
 }
 
-WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy* page)
-    : m_page(page)
-    , m_webView(0)
+WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
+    : m_page(&page)
+    , m_client(&client)
 #if PLATFORM(EFL)
     , m_hasRequestedFullScreen(false)
 #endif
@@ -53,11 +57,6 @@
 {
 }
 
-void WebFullScreenManagerProxy::setWebView(PlatformWebView* webView)
-{
-    m_webView = webView;
-}
-
 void WebFullScreenManagerProxy::willEnterFullScreen()
 {
     m_page->process().send(Messages::WebFullScreenManager::WillEnterFullScreen(), m_page->pageID());
@@ -103,6 +102,59 @@
     m_page->process().send(Messages::WebFullScreenManager::RestoreScrollPosition(), m_page->pageID());
 }
 
+void WebFullScreenManagerProxy::invalidate()
+{
+    m_page->process().removeMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_page->pageID());
+
+    if (!m_client)
+        return;
+
+    m_client->closeFullScreenManager();
+    m_client = nullptr;
+}
+
+void WebFullScreenManagerProxy::close()
+{
+    if (!m_client)
+        return;
+    m_client->closeFullScreenManager();
+}
+
+bool WebFullScreenManagerProxy::isFullScreen()
+{
+    if (!m_client)
+        return false;
+    return m_client->isFullScreen();
+}
+
+void WebFullScreenManagerProxy::enterFullScreen()
+{
+    if (!m_client)
+        return;
+    m_client->enterFullScreen();
+}
+
+void WebFullScreenManagerProxy::exitFullScreen()
+{
+    if (!m_client)
+        return;
+    m_client->exitFullScreen();
+}
+    
+void WebFullScreenManagerProxy::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
+{
+    if (!m_client)
+        return;
+    m_client->beganEnterFullScreen(initialFrame, finalFrame);
+}
+
+void WebFullScreenManagerProxy::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
+{
+    if (!m_client)
+        return;
+    m_client->beganExitFullScreen(initialFrame, finalFrame);
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(FULLSCREEN_API)

Modified: trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h	2013-12-09 04:11:00 UTC (rev 160296)
@@ -37,33 +37,29 @@
 class IntRect;
 }
 
-#if PLATFORM(MAC)
-OBJC_CLASS WKView;
-#elif PLATFORM(GTK)
-typedef struct _WebKitWebViewBase WebKitWebViewBase;
-#endif
-
 namespace WebKit {
-    
-#if PLATFORM(MAC)
-typedef WKView PlatformWebView;
-#elif PLATFORM(GTK)
-typedef WebKitWebViewBase PlatformWebView;
-#elif PLATFORM(EFL)
-typedef Evas_Object PlatformWebView;
-#endif
 
 class WebPageProxy;
-class LayerTreeContext;
 
+class WebFullScreenManagerProxyClient {
+public:
+    virtual ~WebFullScreenManagerProxyClient() { }
+
+    virtual void closeFullScreenManager() = 0;
+    virtual bool isFullScreen() = 0;
+    virtual void enterFullScreen() = 0;
+    virtual void exitFullScreen() = 0;
+    virtual void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) = 0;
+    virtual void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) = 0;
+};
+
 class WebFullScreenManagerProxy : public RefCounted<WebFullScreenManagerProxy>, public CoreIPC::MessageReceiver {
 public:
-    static PassRefPtr<WebFullScreenManagerProxy> create(WebPageProxy*);
+    static PassRefPtr<WebFullScreenManagerProxy> create(WebPageProxy&, WebFullScreenManagerProxyClient&);
     virtual ~WebFullScreenManagerProxy();
 
     void invalidate();
 
-    void setWebView(PlatformWebView*);
     bool isFullScreen();
     void close();
 
@@ -77,7 +73,7 @@
     void restoreScrollPosition();
 
 private:
-    explicit WebFullScreenManagerProxy(WebPageProxy*);
+    explicit WebFullScreenManagerProxy(WebPageProxy&, WebFullScreenManagerProxyClient&);
 
     void supportsFullScreen(bool withKeyboard, bool&);
     void enterFullScreen();
@@ -89,7 +85,7 @@
     virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, std::unique_ptr<CoreIPC::MessageEncoder>&) OVERRIDE;
 
     WebPageProxy* m_page;
-    PlatformWebView* m_webView;
+    WebFullScreenManagerProxyClient* m_client;
 
 #if PLATFORM(EFL)
     bool m_hasRequestedFullScreen;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-12-09 04:11:00 UTC (rev 160296)
@@ -335,7 +335,7 @@
     m_inspector = WebInspectorProxy::create(this);
 #endif
 #if ENABLE(FULLSCREEN_API)
-    m_fullScreenManager = WebFullScreenManagerProxy::create(this);
+    m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
 #endif
 #if ENABLE(VIBRATION)
     m_vibration = WebVibrationProxy::create(this);
@@ -478,7 +478,7 @@
     m_inspector = WebInspectorProxy::create(this);
 #endif
 #if ENABLE(FULLSCREEN_API)
-    m_fullScreenManager = WebFullScreenManagerProxy::create(this);
+    m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
 #endif
 
     initializeWebPage();

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2013-12-09 04:11:00 UTC (rev 160296)
@@ -349,7 +349,6 @@
 
 - (void)beganExitFullScreenWithInitialFrame:(const WebCore::IntRect&)initialFrame finalFrame:(const WebCore::IntRect&)finalFrame
 {
-
     if (_fullScreenState != WaitingToExitFullScreen)
         return;
     _fullScreenState = ExitingFullScreen;

Deleted: trunk/Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm (160295 => 160296)


--- trunk/Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm	2013-12-09 04:11:00 UTC (rev 160296)
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "WebFullScreenManagerProxy.h"
-
-#if ENABLE(FULLSCREEN_API) && !PLATFORM(IOS)
-
-#import "LayerTreeContext.h"
-#import "WKFullScreenWindowController.h"
-#import "WKViewInternal.h"
-#import "WebFullScreenManagerProxyMessages.h"
-#import "WebPageProxy.h"
-#import "WebProcessProxy.h"
-#import <WebCore/IntRect.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-void WebFullScreenManagerProxy::invalidate()
-{
-    m_page->process().removeMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_page->pageID());
-
-    if (!m_webView)
-        return;
-    
-    [m_webView closeFullScreenWindowController];
-    m_webView = 0;
-}
-
-void WebFullScreenManagerProxy::close()
-{
-    if (!m_webView)
-        return;
-    [[m_webView fullScreenWindowController] close];
-}
-
-bool WebFullScreenManagerProxy::isFullScreen()
-{
-    if (!m_webView)
-        return false;
-    if (![m_webView hasFullScreenWindowController])
-        return false;
-
-    return [[m_webView fullScreenWindowController] isFullScreen];
-}
-
-void WebFullScreenManagerProxy::enterFullScreen()
-{
-    if (!m_webView)
-        return;
-    [[m_webView fullScreenWindowController] enterFullScreen:nil];
-}
-
-void WebFullScreenManagerProxy::exitFullScreen()
-{
-    if (!m_webView)
-        return;
-    [[m_webView fullScreenWindowController] exitFullScreen];
-}
-    
-void WebFullScreenManagerProxy::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
-{
-    if (m_webView)
-        [[m_webView fullScreenWindowController] beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
-}
-
-void WebFullScreenManagerProxy::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
-{
-    if (m_webView)
-        [[m_webView fullScreenWindowController] beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
-}
-
-} // namespace WebKit
-
-#endif

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (160295 => 160296)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-12-09 01:08:53 UTC (rev 160295)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-12-09 04:11:00 UTC (rev 160296)
@@ -1228,7 +1228,6 @@
 		CDC3831017212440008A2FC3 /* CookieStorageShim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDC3830D1721242D008A2FC3 /* CookieStorageShim.cpp */; };
 		CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; };
 		CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; };
-		CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */; };
 		CDDF622F1728A20D001EC01F /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCD0042C110C1E27003B8A67 /* CoreServices.framework */; };
 		CEDA12E2152CD1AE00D9E08D /* WebAlternativeTextClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEDA12DF152CCAE800D9E08D /* WebAlternativeTextClient.cpp */; };
 		CEDA12E3152CD1B300D9E08D /* WebAlternativeTextClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CEDA12DE152CCAE800D9E08D /* WebAlternativeTextClient.h */; };
@@ -2843,7 +2842,6 @@
 		CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullScreenWindowController.mm; sourceTree = "<group>"; };
 		CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFullScreenWindowController.h; sourceTree = "<group>"; };
 		CDCA85D4132AC2B300E961DF /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
-		CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFullScreenManagerProxyMac.mm; sourceTree = "<group>"; };
 		CEDA12DE152CCAE800D9E08D /* WebAlternativeTextClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAlternativeTextClient.h; sourceTree = "<group>"; };
 		CEDA12DF152CCAE800D9E08D /* WebAlternativeTextClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAlternativeTextClient.cpp; sourceTree = "<group>"; };
 		D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPopupMenu.cpp; sourceTree = "<group>"; };
@@ -5244,7 +5242,6 @@
 				51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */,
 				51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */,
 				F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */,
-				CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */,
 				1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */,
 				BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */,
 				BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */,
@@ -7267,7 +7264,6 @@
 				755422BD18062BB20046F6A8 /* WKOriginDataManager.cpp in Sources */,
 				CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */,
 				CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
-				CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */,
 				CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */,
 				BC1BE1E112D54A410004A228 /* WebGeolocationClient.cpp in Sources */,
 				BC0E5FE612D697160012A72A /* WebGeolocationManager.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to