Changeset 160296 in webkit


Ignore:
Timestamp:
Dec 8, 2013 8:11:00 PM (10 years ago)
Author:
weinig@apple.com
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.

Location:
trunk/Source/WebKit2
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r160291 r160296  
     12013-12-08  Sam Weinig  <sam@webkit.org>
     2
     3        [Cocoa] Remove knowledge of the WKView from the WebFullScreenManagerProxy by adding a proper client
     4        https://bugs.webkit.org/show_bug.cgi?id=125427
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * UIProcess/API/mac/PageClientImpl.h:
     9        * UIProcess/API/mac/PageClientImpl.mm:
     10        (WebKit::PageClientImpl::fullScreenManagerProxyClient):
     11        (WebKit::PageClientImpl::closeFullScreenManager):
     12        (WebKit::PageClientImpl::isFullScreen):
     13        (WebKit::PageClientImpl::enterFullScreen):
     14        (WebKit::PageClientImpl::exitFullScreen):
     15        (WebKit::PageClientImpl::beganEnterFullScreen):
     16        (WebKit::PageClientImpl::beganExitFullScreen):
     17        Implement the new client.
     18
     19        * UIProcess/API/mac/WKView.mm:
     20        Remove call to setWebView() and do some cleanup.
     21
     22        * UIProcess/API/mac/WKViewInternal.h:
     23        Convert to property syntax and re-arrange.
     24
     25        * UIProcess/PageClient.h:
     26        Expose access to the new client.
     27
     28        * UIProcess/WebFullScreenManagerProxy.cpp:
     29        (WebKit::WebFullScreenManagerProxy::create):
     30        (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
     31        (WebKit::WebFullScreenManagerProxy::invalidate):
     32        (WebKit::WebFullScreenManagerProxy::close):
     33        (WebKit::WebFullScreenManagerProxy::isFullScreen):
     34        (WebKit::WebFullScreenManagerProxy::enterFullScreen):
     35        (WebKit::WebFullScreenManagerProxy::exitFullScreen):
     36        (WebKit::WebFullScreenManagerProxy::beganEnterFullScreen):
     37        (WebKit::WebFullScreenManagerProxy::beganExitFullScreen):
     38        * UIProcess/WebFullScreenManagerProxy.h:
     39        Use the new client.
     40
     41        * UIProcess/WebPageProxy.cpp:
     42        Pass the new client.
     43
     44        * UIProcess/mac/WebFullScreenManagerProxyMac.mm:
     45        Removed. Now goes through the client.
     46
     47        * WebKit2.xcodeproj/project.pbxproj:
     48        Remove WebFullScreenManagerProxyMac.mm.
     49
    1502013-12-07  Sam Weinig  <sam@webkit.org>
    251
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h

    r159859 r160296  
    2929#include "CorrectionPanel.h"
    3030#include "PageClient.h"
     31#include "WebFullScreenManagerProxy.h"
    3132#include <wtf/RetainPtr.h>
    3233
     
    4142class FindIndicatorWindow;
    4243
    43 class PageClientImpl FINAL : public PageClient {
     44class PageClientImpl FINAL : public PageClient
     45#if ENABLE(FULLSCREEN_API)
     46    , public WebFullScreenManagerProxyClient
     47#endif
     48    {
    4449public:
    45     explicit PageClientImpl(WKView*);
     50    explicit PageClientImpl(WKView *);
    4651    virtual ~PageClientImpl();
    4752   
     
    4954
    5055private:
     56    // PageClient
    5157    virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy();
    5258    virtual void setViewNeedsDisplay(const WebCore::IntRect&);
     
    135141#endif
    136142
     143    // Auxiliary Client Creation
     144#if ENABLE(FULLSCREEN_API)
     145    WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() OVERRIDE;
     146#endif
     147
     148#if ENABLE(FULLSCREEN_API)
     149    // WebFullScreenManagerProxyClient
     150    virtual void closeFullScreenManager() OVERRIDE;
     151    virtual bool isFullScreen() OVERRIDE;
     152    virtual void enterFullScreen() OVERRIDE;
     153    virtual void exitFullScreen() OVERRIDE;
     154    virtual void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) OVERRIDE;
     155    virtual void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) OVERRIDE;
     156#endif
     157
    137158    WKView* m_wkView;
    138159    RetainPtr<WKEditorUndoTargetObjC> m_undoTarget;
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm

    r159859 r160296  
    2727#import "PageClientImpl.h"
    2828
    29 #if USE(DICTATION_ALTERNATIVES)
    30 #import <AppKit/NSTextAlternatives.h>
    31 #endif
    3229#import "AttributedString.h"
    3330#import "ColorSpaceData.h"
     
    3633#import "FindIndicator.h"
    3734#import "NativeWebKeyboardEvent.h"
     35#import "StringUtilities.h"
    3836#import "WKAPICast.h"
     37#import "WKFullScreenWindowController.h"
    3938#import "WKStringCF.h"
    4039#import "WKViewInternal.h"
    41 #import "WKViewPrivate.h"
    42 #import "StringUtilities.h"
    4340#import "WebColorPickerMac.h"
    4441#import "WebContextMenuProxyMac.h"
     
    5451#import <WebCore/NotImplemented.h>
    5552#import <WebCore/SharedBuffer.h>
     53#import <WebKitSystemInterface.h>
    5654#import <wtf/text/CString.h>
    5755#import <wtf/text/WTFString.h>
    58 #import <WebKitSystemInterface.h>
     56
     57#if USE(DICTATION_ALTERNATIVES)
     58#import <AppKit/NSTextAlternatives.h>
     59#endif
    5960
    6061@interface NSApplication (WebNSApplicationDetails)
     
    555556#endif
    556557
     558#if ENABLE(FULLSCREEN_API)
     559
     560WebFullScreenManagerProxyClient& PageClientImpl::fullScreenManagerProxyClient()
     561{
     562    return *this;
     563}
     564
     565// WebFullScreenManagerProxyClient
     566
     567void PageClientImpl::closeFullScreenManager()
     568{
     569    [m_wkView _closeFullScreenWindowController];
     570}
     571
     572bool PageClientImpl::isFullScreen()
     573{
     574    if (!m_wkView._hasFullScreenWindowController)
     575        return false;
     576
     577    return m_wkView._fullScreenWindowController.isFullScreen;
     578}
     579
     580void PageClientImpl::enterFullScreen()
     581{
     582    [m_wkView._fullScreenWindowController enterFullScreen:nil];
     583}
     584
     585void PageClientImpl::exitFullScreen()
     586{
     587    [m_wkView._fullScreenWindowController exitFullScreen];
     588}
     589
     590void PageClientImpl::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
     591{
     592    [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
     593}
     594
     595void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
     596{
     597    [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
     598}
     599
     600#endif // ENABLE(FULLSCREEN_API)
     601
    557602} // namespace WebKit
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r159903 r160296  
    5959#import "WebContext.h"
    6060#import "WebEventFactory.h"
    61 #import "WebFullScreenManagerProxy.h"
    6261#import "WebKit2Initialize.h"
    6362#import "WebPage.h"
     
    7675#import <WebCore/Image.h>
    7776#import <WebCore/IntRect.h>
     77#import <WebCore/FileSystem.h>
    7878#import <WebCore/KeyboardEvent.h>
    7979#import <WebCore/LocalizedStrings.h>
     
    8383#import <WebCore/SharedBuffer.h>
    8484#import <WebCore/TextAlternativeWithRange.h>
    85 #import <WebCore/WebCoreNSStringExtras.h>
    8685#import <WebCore/WebCoreFullScreenPlaceholderView.h>
    8786#import <WebCore/WebCoreFullScreenWindow.h>
    88 #import <WebCore/FileSystem.h>
     87#import <WebCore/WebCoreNSStringExtras.h>
    8988#import <WebKitSystemInterface.h>
    9089#import <sys/stat.h>
     
    27832782
    27842783#if ENABLE(FULLSCREEN_API)
    2785 - (BOOL)hasFullScreenWindowController
     2784- (BOOL)_hasFullScreenWindowController
    27862785{
    27872786    return (bool)_data->_fullScreenWindowController;
    27882787}
    27892788
    2790 - (WKFullScreenWindowController*)fullScreenWindowController
     2789- (WKFullScreenWindowController *)_fullScreenWindowController
    27912790{
    27922791    if (!_data->_fullScreenWindowController)
     
    27962795}
    27972796
    2798 - (void)closeFullScreenWindowController
     2797- (void)_closeFullScreenWindowController
    27992798{
    28002799    if (!_data->_fullScreenWindowController)
    28012800        return;
    2802     [_data->_fullScreenWindowController.get() close];
     2801
     2802    [_data->_fullScreenWindowController close];
    28032803    _data->_fullScreenWindowController = nullptr;
    28042804}
     
    29122912    _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
    29132913    _data->_page->initializeWebPage();
    2914 #if ENABLE(FULLSCREEN_API)
    2915     _data->_page->fullScreenManager()->setWebView(self);
    2916 #endif
     2914
    29172915    _data->_mouseDownEvent = nil;
    29182916    _data->_ignoringMouseDraggedEvents = NO;
     
    31233121}
    31243122
    3125 - (NSView*)fullScreenPlaceholderView
     3123- (NSView *)fullScreenPlaceholderView
    31263124{
    31273125#if ENABLE(FULLSCREEN_API)
     
    31323130}
    31333131
    3134 - (void)beginDeferringViewInWindowChanges
    3135 {
    3136     if (_data->_shouldDeferViewInWindowChanges) {
    3137         NSLog(@"beginDeferringViewInWindowChanges was called while already deferring view-in-window changes!");
    3138         return;
    3139     }
    3140 
    3141     _data->_shouldDeferViewInWindowChanges = YES;
    3142 }
    3143 
    3144 - (void)endDeferringViewInWindowChanges
    3145 {
    3146     if (!_data->_shouldDeferViewInWindowChanges) {
    3147         NSLog(@"endDeferringViewInWindowChanges was called without beginDeferringViewInWindowChanges!");
    3148         return;
    3149     }
    3150 
    3151     _data->_shouldDeferViewInWindowChanges = NO;
    3152 
    3153     if (_data->_viewInWindowChangeWasDeferred) {
    3154         _data->_page->viewStateDidChange(ViewState::IsInWindow);
    3155         _data->_viewInWindowChangeWasDeferred = NO;
    3156     }
    3157 }
    3158 
    3159 - (void)endDeferringViewInWindowChangesSync
    3160 {
    3161     if (!_data->_shouldDeferViewInWindowChanges) {
    3162         NSLog(@"endDeferringViewInWindowChangesSync was called without beginDeferringViewInWindowChanges!");
    3163         return;
    3164     }
    3165 
    3166     PageClient* pageClient = _data->_pageClient.get();
    3167     bool hasPendingViewInWindowChange = _data->_viewInWindowChangeWasDeferred && _data->_page->isInWindow() != pageClient->isViewInWindow();
    3168 
    3169     _data->_shouldDeferViewInWindowChanges = NO;
    3170 
    3171     if (_data->_viewInWindowChangeWasDeferred) {
    3172         _data->_page->viewStateDidChange(ViewState::IsInWindow, hasPendingViewInWindowChange ? WebPageProxy::WantsReplyOrNot::DoesWantReply : WebPageProxy::WantsReplyOrNot::DoesNotWantReply);
    3173         _data->_viewInWindowChangeWasDeferred = NO;
    3174     }
    3175 
    3176     if (hasPendingViewInWindowChange)
    3177         _data->_page->waitForDidUpdateViewState();
    3178 }
    3179 
    3180 - (BOOL)isDeferringViewInWindowChanges
    3181 {
    3182     return _data->_shouldDeferViewInWindowChanges;
    3183 }
    3184 
    3185 - (BOOL)windowOcclusionDetectionEnabled
    3186 {
    3187     return _data->_windowOcclusionDetectionEnabled;
    3188 }
    3189 
    3190 - (void)setWindowOcclusionDetectionEnabled:(BOOL)flag
    3191 {
    3192     _data->_windowOcclusionDetectionEnabled = flag;
    3193 }
    3194 
    3195 - (void)setContentAnchor:(WKContentAnchor)contentAnchor
    3196 {
    3197     _data->_contentAnchor = contentAnchor;
    3198 }
    3199 
    3200 - (WKContentAnchor)contentAnchor
    3201 {
    3202     return _data->_contentAnchor;
    3203 }
    3204 
    3205 // This method forces a drawing area geometry update, even if frame size updates are disabled.
    3206 // The updated is performed asynchronously; we don't wait for the geometry update before returning.
    3207 // The area drawn need not match the current frame size - if it differs it will be anchored to the
    3208 // frame according to the current contentAnchor.
    3209 - (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size
    3210 {
    3211     if (_data->_clipsToVisibleRect)
    3212         [self _updateViewExposedRect];
    3213     [self _setDrawingAreaSize:size];
    3214 
    3215     // If a geometry update is pending the new update won't be sent. Poll without waiting for any
    3216     // pending did-update message now, such that the new update can be sent. We do so after setting
    3217     // the drawing area size such that the latest update is sent.
    3218     if (DrawingAreaProxy* drawingArea = _data->_page->drawingArea())
    3219         drawingArea->waitForPossibleGeometryUpdate(0);
    3220 }
    3221 
    3222 - (void)waitForAsyncDrawingAreaSizeUpdate
    3223 {
    3224     if (DrawingAreaProxy* drawingArea = _data->_page->drawingArea()) {
    3225         // If a geometry update is still pending then the action of recieving the
    3226         // first geometry update may result in another update being scheduled -
    3227         // we should wait for this to complete too.
    3228         drawingArea->waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout * 0.5);
    3229         drawingArea->waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout * 0.5);
    3230     }
    3231 }
    3232 
    3233 - (NSWindow*)createFullScreenWindow
     3132- (NSWindow *)createFullScreenWindow
    32343133{
    32353134#if ENABLE(FULLSCREEN_API)
     
    32453144}
    32463145
     3146- (void)beginDeferringViewInWindowChanges
     3147{
     3148    if (_data->_shouldDeferViewInWindowChanges) {
     3149        NSLog(@"beginDeferringViewInWindowChanges was called while already deferring view-in-window changes!");
     3150        return;
     3151    }
     3152
     3153    _data->_shouldDeferViewInWindowChanges = YES;
     3154}
     3155
     3156- (void)endDeferringViewInWindowChanges
     3157{
     3158    if (!_data->_shouldDeferViewInWindowChanges) {
     3159        NSLog(@"endDeferringViewInWindowChanges was called without beginDeferringViewInWindowChanges!");
     3160        return;
     3161    }
     3162
     3163    _data->_shouldDeferViewInWindowChanges = NO;
     3164
     3165    if (_data->_viewInWindowChangeWasDeferred) {
     3166        _data->_page->viewStateDidChange(ViewState::IsInWindow);
     3167        _data->_viewInWindowChangeWasDeferred = NO;
     3168    }
     3169}
     3170
     3171- (void)endDeferringViewInWindowChangesSync
     3172{
     3173    if (!_data->_shouldDeferViewInWindowChanges) {
     3174        NSLog(@"endDeferringViewInWindowChangesSync was called without beginDeferringViewInWindowChanges!");
     3175        return;
     3176    }
     3177
     3178    PageClient* pageClient = _data->_pageClient.get();
     3179    bool hasPendingViewInWindowChange = _data->_viewInWindowChangeWasDeferred && _data->_page->isInWindow() != pageClient->isViewInWindow();
     3180
     3181    _data->_shouldDeferViewInWindowChanges = NO;
     3182
     3183    if (_data->_viewInWindowChangeWasDeferred) {
     3184        _data->_page->viewStateDidChange(ViewState::IsInWindow, hasPendingViewInWindowChange ? WebPageProxy::WantsReplyOrNot::DoesWantReply : WebPageProxy::WantsReplyOrNot::DoesNotWantReply);
     3185        _data->_viewInWindowChangeWasDeferred = NO;
     3186    }
     3187
     3188    if (hasPendingViewInWindowChange)
     3189        _data->_page->waitForDidUpdateViewState();
     3190}
     3191
     3192- (BOOL)isDeferringViewInWindowChanges
     3193{
     3194    return _data->_shouldDeferViewInWindowChanges;
     3195}
     3196
     3197- (BOOL)windowOcclusionDetectionEnabled
     3198{
     3199    return _data->_windowOcclusionDetectionEnabled;
     3200}
     3201
     3202- (void)setWindowOcclusionDetectionEnabled:(BOOL)flag
     3203{
     3204    _data->_windowOcclusionDetectionEnabled = flag;
     3205}
     3206
     3207- (void)setContentAnchor:(WKContentAnchor)contentAnchor
     3208{
     3209    _data->_contentAnchor = contentAnchor;
     3210}
     3211
     3212- (WKContentAnchor)contentAnchor
     3213{
     3214    return _data->_contentAnchor;
     3215}
     3216
     3217// This method forces a drawing area geometry update, even if frame size updates are disabled.
     3218// The updated is performed asynchronously; we don't wait for the geometry update before returning.
     3219// The area drawn need not match the current frame size - if it differs it will be anchored to the
     3220// frame according to the current contentAnchor.
     3221- (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size
     3222{
     3223    if (_data->_clipsToVisibleRect)
     3224        [self _updateViewExposedRect];
     3225    [self _setDrawingAreaSize:size];
     3226
     3227    // If a geometry update is pending the new update won't be sent. Poll without waiting for any
     3228    // pending did-update message now, such that the new update can be sent. We do so after setting
     3229    // the drawing area size such that the latest update is sent.
     3230    if (DrawingAreaProxy* drawingArea = _data->_page->drawingArea())
     3231        drawingArea->waitForPossibleGeometryUpdate(0);
     3232}
     3233
     3234- (void)waitForAsyncDrawingAreaSizeUpdate
     3235{
     3236    if (DrawingAreaProxy* drawingArea = _data->_page->drawingArea()) {
     3237        // If a geometry update is still pending then the action of recieving the
     3238        // first geometry update may result in another update being scheduled -
     3239        // we should wait for this to complete too.
     3240        drawingArea->waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout * 0.5);
     3241        drawingArea->waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout * 0.5);
     3242    }
     3243}
     3244
    32473245- (BOOL)isUsingUISideCompositing
    32483246{
  • trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h

    r159760 r160296  
    2424 */
    2525
    26 #import "WKView.h"
     26#import "WKViewPrivate.h"
    2727
    2828#import "PluginComplexTextInputState.h"
     
    8484- (WebKit::ColorSpaceData)_colorSpace;
    8585
    86 #if ENABLE(FULLSCREEN_API)
    87 - (BOOL)hasFullScreenWindowController;
    88 - (WKFullScreenWindowController*)fullScreenWindowController;
    89 - (void)closeFullScreenWindowController;
    90 #endif
    91 
    9286- (void)_cacheWindowBottomCornerRect;
    9387
     
    9892- (BOOL)_suppressVisibilityUpdates;
    9993
     94// FullScreen
     95
     96@property (readonly) BOOL _hasFullScreenWindowController;
     97@property (readonly) WKFullScreenWindowController *_fullScreenWindowController;
     98- (void)_closeFullScreenWindowController;
     99
    100100@end
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r159985 r160296  
    4444OBJC_CLASS NSTextAlternatives;
    4545#endif
    46 
    47 #if PLATFORM(IOS)
    48 OBJC_CLASS UIWKView;
    49 #endif
    5046#endif
    5147
     
    6056class FindIndicator;
    6157class NativeWebKeyboardEvent;
    62 #if ENABLE(TOUCH_EVENTS)
    63 class NativeWebTouchEvent;
    64 #endif
    6558class WebContextMenuProxy;
    6659class WebEditCommandProxy;
    6760class WebPopupMenuProxy;
     61
     62#if ENABLE(TOUCH_EVENTS)
     63class NativeWebTouchEvent;
     64#endif
     65
    6866#if ENABLE(INPUT_TYPE_COLOR)
    6967class WebColorPicker;
     68#endif
     69
     70#if ENABLE(FULLSCREEN_API)
     71class WebFullScreenManagerProxyClient;
    7072#endif
    7173
     
    243245    virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0;
    244246#endif
     247
     248    // Auxiliary Client Creation
     249#if ENABLE(FULLSCREEN_API)
     250    virtual WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() = 0;
     251#endif
    245252};
    246253
  • trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp

    r159903 r160296  
    2929#if ENABLE(FULLSCREEN_API)
    3030
    31 #include "WebContext.h"
    3231#include "WebFullScreenManagerMessages.h"
    3332#include "WebFullScreenManagerProxyMessages.h"
     33#include "WebPageProxy.h"
     34#include "WebProcessProxy.h"
     35#include <WebCore/IntRect.h>
     36
     37using namespace WebCore;
    3438
    3539namespace WebKit {
    3640
    37 PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy* page)
     41PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
    3842{
    39     return adoptRef(new WebFullScreenManagerProxy(page));
     43    return adoptRef(new WebFullScreenManagerProxy(page, client));
    4044}
    4145
    42 WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy* page)
    43     : m_page(page)
    44     , m_webView(0)
     46WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
     47    : m_page(&page)
     48    , m_client(&client)
    4549#if PLATFORM(EFL)
    4650    , m_hasRequestedFullScreen(false)
     
    5256WebFullScreenManagerProxy::~WebFullScreenManagerProxy()
    5357{
    54 }
    55 
    56 void WebFullScreenManagerProxy::setWebView(PlatformWebView* webView)
    57 {
    58     m_webView = webView;
    5958}
    6059
     
    104103}
    105104
     105void WebFullScreenManagerProxy::invalidate()
     106{
     107    m_page->process().removeMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_page->pageID());
     108
     109    if (!m_client)
     110        return;
     111
     112    m_client->closeFullScreenManager();
     113    m_client = nullptr;
     114}
     115
     116void WebFullScreenManagerProxy::close()
     117{
     118    if (!m_client)
     119        return;
     120    m_client->closeFullScreenManager();
     121}
     122
     123bool WebFullScreenManagerProxy::isFullScreen()
     124{
     125    if (!m_client)
     126        return false;
     127    return m_client->isFullScreen();
     128}
     129
     130void WebFullScreenManagerProxy::enterFullScreen()
     131{
     132    if (!m_client)
     133        return;
     134    m_client->enterFullScreen();
     135}
     136
     137void WebFullScreenManagerProxy::exitFullScreen()
     138{
     139    if (!m_client)
     140        return;
     141    m_client->exitFullScreen();
     142}
     143   
     144void WebFullScreenManagerProxy::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
     145{
     146    if (!m_client)
     147        return;
     148    m_client->beganEnterFullScreen(initialFrame, finalFrame);
     149}
     150
     151void WebFullScreenManagerProxy::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
     152{
     153    if (!m_client)
     154        return;
     155    m_client->beganExitFullScreen(initialFrame, finalFrame);
     156}
     157
    106158} // namespace WebKit
    107159
  • trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h

    r156847 r160296  
    3838}
    3939
    40 #if PLATFORM(MAC)
    41 OBJC_CLASS WKView;
    42 #elif PLATFORM(GTK)
    43 typedef struct _WebKitWebViewBase WebKitWebViewBase;
    44 #endif
    45 
    4640namespace WebKit {
    47    
    48 #if PLATFORM(MAC)
    49 typedef WKView PlatformWebView;
    50 #elif PLATFORM(GTK)
    51 typedef WebKitWebViewBase PlatformWebView;
    52 #elif PLATFORM(EFL)
    53 typedef Evas_Object PlatformWebView;
    54 #endif
    5541
    5642class WebPageProxy;
    57 class LayerTreeContext;
     43
     44class WebFullScreenManagerProxyClient {
     45public:
     46    virtual ~WebFullScreenManagerProxyClient() { }
     47
     48    virtual void closeFullScreenManager() = 0;
     49    virtual bool isFullScreen() = 0;
     50    virtual void enterFullScreen() = 0;
     51    virtual void exitFullScreen() = 0;
     52    virtual void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) = 0;
     53    virtual void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) = 0;
     54};
    5855
    5956class WebFullScreenManagerProxy : public RefCounted<WebFullScreenManagerProxy>, public CoreIPC::MessageReceiver {
    6057public:
    61     static PassRefPtr<WebFullScreenManagerProxy> create(WebPageProxy*);
     58    static PassRefPtr<WebFullScreenManagerProxy> create(WebPageProxy&, WebFullScreenManagerProxyClient&);
    6259    virtual ~WebFullScreenManagerProxy();
    6360
    6461    void invalidate();
    6562
    66     void setWebView(PlatformWebView*);
    6763    bool isFullScreen();
    6864    void close();
     
    7874
    7975private:
    80     explicit WebFullScreenManagerProxy(WebPageProxy*);
     76    explicit WebFullScreenManagerProxy(WebPageProxy&, WebFullScreenManagerProxyClient&);
    8177
    8278    void supportsFullScreen(bool withKeyboard, bool&);
     
    9086
    9187    WebPageProxy* m_page;
    92     PlatformWebView* m_webView;
     88    WebFullScreenManagerProxyClient* m_client;
    9389
    9490#if PLATFORM(EFL)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r160137 r160296  
    336336#endif
    337337#if ENABLE(FULLSCREEN_API)
    338     m_fullScreenManager = WebFullScreenManagerProxy::create(this);
     338    m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
    339339#endif
    340340#if ENABLE(VIBRATION)
     
    479479#endif
    480480#if ENABLE(FULLSCREEN_API)
    481     m_fullScreenManager = WebFullScreenManagerProxy::create(this);
     481    m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
    482482#endif
    483483
  • trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

    r159760 r160296  
    350350- (void)beganExitFullScreenWithInitialFrame:(const WebCore::IntRect&)initialFrame finalFrame:(const WebCore::IntRect&)finalFrame
    351351{
    352 
    353352    if (_fullScreenState != WaitingToExitFullScreen)
    354353        return;
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r160278 r160296  
    12291229                CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; };
    12301230                CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; };
    1231                 CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */; };
    12321231                CDDF622F1728A20D001EC01F /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCD0042C110C1E27003B8A67 /* CoreServices.framework */; };
    12331232                CEDA12E2152CD1AE00D9E08D /* WebAlternativeTextClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEDA12DF152CCAE800D9E08D /* WebAlternativeTextClient.cpp */; };
     
    28442843                CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFullScreenWindowController.h; sourceTree = "<group>"; };
    28452844                CDCA85D4132AC2B300E961DF /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
    2846                 CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFullScreenManagerProxyMac.mm; sourceTree = "<group>"; };
    28472845                CEDA12DE152CCAE800D9E08D /* WebAlternativeTextClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAlternativeTextClient.h; sourceTree = "<group>"; };
    28482846                CEDA12DF152CCAE800D9E08D /* WebAlternativeTextClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAlternativeTextClient.cpp; sourceTree = "<group>"; };
     
    52455243                                51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */,
    52465244                                F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */,
    5247                                 CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */,
    52485245                                1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */,
    52495246                                BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */,
     
    72687265                                CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */,
    72697266                                CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
    7270                                 CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */,
    72717267                                CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */,
    72727268                                BC1BE1E112D54A410004A228 /* WebGeolocationClient.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.