Changeset 223267 in webkit


Ignore:
Timestamp:
Oct 12, 2017 5:41:45 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
https://bugs.webkit.org/show_bug.cgi?id=178240
<rdar://problem/34962720>

Reviewed by Tim Horton.

Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _dismissContentRelativeChildWindows]):
(-[WKWebView _setFrame:andScrollBy:]):
(-[WKWebView _setTotalHeightOfBanners:]):
(-[WKWebView _totalHeightOfBanners]):
(-[WKWebView _beginDeferringViewInWindowChanges]):
(-[WKWebView _endDeferringViewInWindowChanges]):
(-[WKWebView _endDeferringViewInWindowChangesSync]):
(-[WKWebView _gestureEventWasNotHandledByWebCore:]):
(-[WKWebView _setIgnoresNonWheelEvents:]):
(-[WKWebView _ignoresNonWheelEvents]):
(-[WKWebView _setCustomSwipeViews:]):
(-[WKWebView _setCustomSwipeViewsTopContentInset:]):
(-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
(-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
(-[WKWebView _fullScreenPlaceholderView]):
(-[WKWebView _fullScreenWindow]):
(-[WKWebView _disableFrameSizeUpdates]):
(-[WKWebView _enableFrameSizeUpdates]):
(-[WKWebView _canChangeFrameLayout:]):
(-[WKWebView _underlayColor]):
(-[WKWebView _setUnderlayColor:]):

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:
  • UIProcess/API/mac/WKView.mm:

(-[WKView createFullScreenWindow]):

  • UIProcess/Cocoa/WebViewImpl.h:
  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::WebViewImpl::fullScreenWindowController):
(WebKit::WebViewImpl::fullScreenWindow):
(WebKit::WebViewImpl::createFullScreenWindow): Deleted.

Location:
trunk/Source/WebKit
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r223265 r223267  
     12017-10-12  Alex Christensen  <achristensen@webkit.org>
     2
     3        Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
     4        https://bugs.webkit.org/show_bug.cgi?id=178240
     5        <rdar://problem/34962720>
     6
     7        Reviewed by Tim Horton.
     8       
     9        Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
     10        an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.
     11
     12        * UIProcess/API/Cocoa/WKWebView.mm:
     13        (-[WKWebView _dismissContentRelativeChildWindows]):
     14        (-[WKWebView _setFrame:andScrollBy:]):
     15        (-[WKWebView _setTotalHeightOfBanners:]):
     16        (-[WKWebView _totalHeightOfBanners]):
     17        (-[WKWebView _beginDeferringViewInWindowChanges]):
     18        (-[WKWebView _endDeferringViewInWindowChanges]):
     19        (-[WKWebView _endDeferringViewInWindowChangesSync]):
     20        (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
     21        (-[WKWebView _setIgnoresNonWheelEvents:]):
     22        (-[WKWebView _ignoresNonWheelEvents]):
     23        (-[WKWebView _setCustomSwipeViews:]):
     24        (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
     25        (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
     26        (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
     27        (-[WKWebView _fullScreenPlaceholderView]):
     28        (-[WKWebView _fullScreenWindow]):
     29        (-[WKWebView _disableFrameSizeUpdates]):
     30        (-[WKWebView _enableFrameSizeUpdates]):
     31        (-[WKWebView _canChangeFrameLayout:]):
     32        (-[WKWebView _underlayColor]):
     33        (-[WKWebView _setUnderlayColor:]):
     34        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
     35        * UIProcess/API/mac/WKView.mm:
     36        (-[WKView createFullScreenWindow]):
     37        * UIProcess/Cocoa/WebViewImpl.h:
     38        * UIProcess/Cocoa/WebViewImpl.mm:
     39        (WebKit::WebViewImpl::fullScreenWindowController):
     40        (WebKit::WebViewImpl::fullScreenWindow):
     41        (WebKit::WebViewImpl::createFullScreenWindow): Deleted.
     42
    1432017-10-12  Youenn Fablet  <youenn@apple.com>
    244
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h

    r222059 r223267  
    150150#endif
    151151- (void)_webView:(WKWebView *)webView didChangeSafeAreaShouldAffectObscuredInsets:(BOOL)safeAreaShouldAffectObscuredInsets WK_API_AVAILABLE(ios(11.0));
    152 #else
     152#else // TARGET_OS_IPHONE
     153- (void)_prepareForImmediateActionAnimationForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     154- (void)_cancelImmediateActionAnimationForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     155- (void)_completeImmediateActionAnimationForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
    153156- (void)_showWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
    154157- (void)_focusWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     
    175178- (NSMenu *)_webView:(WKWebView *)webView contextMenu:(NSMenu *)menu forElement:(_WKContextMenuElementInfo *)element WK_API_AVAILABLE(macosx(10.12));
    176179- (NSMenu *)_webView:(WKWebView *)webView contextMenu:(NSMenu *)menu forElement:(_WKContextMenuElementInfo *)element userInfo:(id <NSSecureCoding>)userInfo WK_API_AVAILABLE(macosx(10.12));
    177 #endif
     180#endif // TARGET_OS_IPHONE
    178181
    179182@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h

    r222577 r223267  
    2727
    2828#import <WebKit/WKBase.h>
    29 #import <WebKit/WKImmediateActionTypes.h>
    3029#import <WebKit/WKLayoutMode.h>
    3130#import <WebKit/WKView.h>
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r223082 r223267  
    36843684}
    36853685
    3686 // We don't expose these various bits of SPI like WKView does,
    3687 // so have these internal methods just do the work (or do nothing):
    36883686- (void)_web_prepareForImmediateActionAnimation
    36893687{
     3688    id <WKUIDelegatePrivate> uiDelegate = (id <WKUIDelegatePrivate>)[self UIDelegate];
     3689    if ([uiDelegate respondsToSelector:@selector(_prepareForImmediateActionAnimationForWebView:)])
     3690        [uiDelegate _prepareForImmediateActionAnimationForWebView:self];
     3691    else
     3692        [self _prepareForImmediateActionAnimation];
    36903693}
    36913694
    36923695- (void)_web_cancelImmediateActionAnimation
    36933696{
     3697    id <WKUIDelegatePrivate> uiDelegate = (id <WKUIDelegatePrivate>)[self UIDelegate];
     3698    if ([uiDelegate respondsToSelector:@selector(_cancelImmediateActionAnimationForWebView:)])
     3699        [uiDelegate _cancelImmediateActionAnimationForWebView:self];
     3700    else
     3701        [self _cancelImmediateActionAnimation];
    36943702}
    36953703
    36963704- (void)_web_completeImmediateActionAnimation
    36973705{
     3706    id <WKUIDelegatePrivate> uiDelegate = (id <WKUIDelegatePrivate>)[self UIDelegate];
     3707    if ([uiDelegate respondsToSelector:@selector(_completeImmediateActionAnimationForWebView:)])
     3708        [uiDelegate _completeImmediateActionAnimationForWebView:self];
     3709    else
     3710        [self _completeImmediateActionAnimation];
    36983711}
    36993712
     
    53495362- (NSPrintOperation *)_printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(_WKFrameHandle *)frameHandle
    53505363{
    5351     if (auto webFrameProxy = _page->process().webFrame(frameHandle._frameID))
     5364    if (auto* webFrameProxy = _page->process().webFrame(frameHandle._frameID))
    53525365        return _impl->printOperationWithPrintInfo(printInfo, *webFrameProxy);
    53535366    return nil;
     
    56615674}
    56625675
     5676- (void)_dismissContentRelativeChildWindows
     5677{
     5678    _impl->dismissContentRelativeChildWindowsFromViewOnly();
     5679}
     5680
     5681- (void)_setFrame:(NSRect)rect andScrollBy:(NSSize)offset
     5682{
     5683    _impl->setFrameAndScrollBy(NSRectToCGRect(rect), NSSizeToCGSize(offset));
     5684}
     5685
     5686- (void)_setTotalHeightOfBanners:(CGFloat)totalHeightOfBanners
     5687{
     5688    _impl->setTotalHeightOfBanners(totalHeightOfBanners);
     5689}
     5690
     5691- (CGFloat)_totalHeightOfBanners
     5692{
     5693    return _impl->totalHeightOfBanners();
     5694}
     5695
     5696- (void)_beginDeferringViewInWindowChanges
     5697{
     5698    _impl->beginDeferringViewInWindowChanges();
     5699}
     5700
     5701- (void)_endDeferringViewInWindowChanges
     5702{
     5703    _impl->endDeferringViewInWindowChanges();
     5704}
     5705
     5706- (void)_endDeferringViewInWindowChangesSync
     5707{
     5708    _impl->endDeferringViewInWindowChangesSync();
     5709}
     5710
     5711- (void)_gestureEventWasNotHandledByWebCore:(NSEvent *)event
     5712{
     5713    _impl->gestureEventWasNotHandledByWebCoreFromViewOnly(event);
     5714}
     5715
     5716- (void)_setIgnoresNonWheelEvents:(BOOL)ignoresNonWheelEvents
     5717{
     5718    _impl->setIgnoresNonWheelEvents(ignoresNonWheelEvents);
     5719}
     5720
     5721- (BOOL)_ignoresNonWheelEvents
     5722{
     5723    return _impl->ignoresNonWheelEvents();
     5724}
     5725
     5726- (void)_setCustomSwipeViews:(NSArray *)customSwipeViews
     5727{
     5728    _impl->setCustomSwipeViews(customSwipeViews);
     5729}
     5730
     5731- (void)_setCustomSwipeViewsTopContentInset:(float)topContentInset
     5732{
     5733    _impl->setCustomSwipeViewsTopContentInset(topContentInset);
     5734}
     5735
     5736- (BOOL)_tryToSwipeWithEvent:(NSEvent *)event ignoringPinnedState:(BOOL)ignoringPinnedState
     5737{
     5738    return _impl->tryToSwipeWithEvent(event, ignoringPinnedState);
     5739}
     5740
     5741- (void)_setDidMoveSwipeSnapshotCallback:(void(^)(CGRect))callback
     5742{
     5743    _impl->setDidMoveSwipeSnapshotCallback(callback);
     5744}
     5745
     5746- (NSView *)_fullScreenPlaceholderView
     5747{
     5748    return _impl->fullScreenPlaceholderView();
     5749}
     5750
     5751- (NSWindow *)_fullScreenWindow
     5752{
     5753    return _impl->fullScreenWindow();
     5754}
     5755
     5756- (void)_disableFrameSizeUpdates
     5757{
     5758    _impl->disableFrameSizeUpdates();
     5759}
     5760
     5761- (void)_enableFrameSizeUpdates
     5762{
     5763    _impl->enableFrameSizeUpdates();
     5764}
     5765
     5766- (void)_prepareForImmediateActionAnimation
     5767{
     5768}
     5769
     5770- (void)_cancelImmediateActionAnimation
     5771{
     5772}
     5773
     5774- (void)_completeImmediateActionAnimation
     5775{
     5776}
     5777
     5778- (BOOL)_canChangeFrameLayout:(_WKFrameHandle *)frameHandle
     5779{
     5780    if (auto* webFrameProxy = _page->process().webFrame(frameHandle._frameID))
     5781        return _impl->canChangeFrameLayout(*webFrameProxy);
     5782    return false;
     5783}
     5784
     5785- (NSColor *)_underlayColor
     5786{
     5787    return _impl->underlayColor();
     5788}
     5789
     5790- (void)_setUnderlayColor:(NSColor *)underlayColor
     5791{
     5792    _impl->setUnderlayColor(underlayColor);
     5793}
     5794
    56635795- (BOOL)_hasActiveVideoForControlsManager
    56645796{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r222212 r223267  
    386386- (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text completionHandler:(void (^)(NSArray<NSValue *> *rects))completionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA));
    387387
    388 #endif // TARGET_OS_IPHONE
    389 
    390 #if !TARGET_OS_IPHONE
     388#else
     389- (void)_dismissContentRelativeChildWindows WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     390- (void)_setFrame:(NSRect)rect andScrollBy:(NSSize)offset WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     391- (void)_beginDeferringViewInWindowChanges WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     392- (void)_endDeferringViewInWindowChanges WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     393- (void)_endDeferringViewInWindowChangesSync WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     394- (void)_gestureEventWasNotHandledByWebCore:(NSEvent *)event WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     395- (void)_setCustomSwipeViews:(NSArray *)customSwipeViews WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     396- (void)_setCustomSwipeViewsTopContentInset:(float)topContentInset WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     397- (NSView *)_fullScreenPlaceholderView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     398- (NSWindow *)_fullScreenWindow WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     399- (void)_disableFrameSizeUpdates WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     400- (void)_enableFrameSizeUpdates WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     401- (void)_prepareForImmediateActionAnimation WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     402- (void)_cancelImmediateActionAnimation WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     403- (void)_completeImmediateActionAnimation WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     404- (BOOL)_canChangeFrameLayout:(_WKFrameHandle *)frameHandle WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     405- (BOOL)_tryToSwipeWithEvent:(NSEvent *)event ignoringPinnedState:(BOOL)ignoringPinnedState WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     406- (void)_setDidMoveSwipeSnapshotCallback:(void(^)(CGRect))callback WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     407@property (nonatomic, setter=_setTotalHeightOfBanners:) CGFloat _totalHeightOfBanners WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     408@property (nonatomic, copy, setter=_setUnderlayColor:) NSColor *_underlayColor;
     409@property (nonatomic, readwrite, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents WK_API_AVAILABLE(macosx(WK_MAC_TBA));
    391410@property (nonatomic, readonly) WKPageRef _pageRefForTransitionToWKWebView  WK_API_AVAILABLE(macosx(WK_MAC_TBA));
    392411@property (nonatomic, readonly) BOOL _hasActiveVideoForControlsManager WK_API_AVAILABLE(macosx(10.12));
  • trunk/Source/WebKit/UIProcess/API/mac/WKView.mm

    r222577 r223267  
    12461246- (NSWindow *)createFullScreenWindow
    12471247{
    1248     return _data->_impl->createFullScreenWindow();
     1248    return _data->_impl->fullScreenWindow();
    12491249}
    12501250
  • trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h

    r222422 r223267  
    283283#endif
    284284    NSView *fullScreenPlaceholderView();
    285     NSWindow *createFullScreenWindow();
     285    NSWindow *fullScreenWindow();
    286286
    287287    bool isEditable() const;
  • trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm

    r222896 r223267  
    24332433{
    24342434    if (!m_fullScreenWindowController)
    2435         m_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:createFullScreenWindow() webView:m_view.getAutoreleased() page:m_page]);
     2435        m_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:fullScreenWindow() webView:m_view.getAutoreleased() page:m_page]);
    24362436
    24372437    return m_fullScreenWindowController.get();
     
    24572457}
    24582458
    2459 NSWindow *WebViewImpl::createFullScreenWindow()
     2459NSWindow *WebViewImpl::fullScreenWindow()
    24602460{
    24612461#if ENABLE(FULLSCREEN_API)
Note: See TracChangeset for help on using the changeset viewer.