Changeset 166257 in webkit


Ignore:
Timestamp:
Mar 25, 2014, 2:52:20 PM (10 years ago)
Author:
Joseph Pecoraro
Message:

[iOS] Inspector View Indication Support
https://bugs.webkit.org/show_bug.cgi?id=130709

Reviewed by Simon Fraser.

Source/WebCore:

  • inspector/InspectorClient.h:

(WebCore::InspectorClient::showInspectorIndication):
(WebCore::InspectorClient::hideInspectorIndication):

  • inspector/InspectorController.cpp:

(WebCore::InspectorController::setIndicating):
Rename indicate/hideIndication to show/hide names.

Source/WebKit/ios:

  • WebCoreSupport/WebInspectorClientIOS.mm:

(WebInspectorClient::showInspectorIndication):
(WebInspectorClient::hideInspectorIndication):
Renamed methods.

Source/WebKit/mac:

  • WebCoreSupport/WebInspectorClient.h:
  • WebCoreSupport/WebInspectorClient.mm:

(WebInspectorClient::didSetSearchingForNode): Deleted.
(WebInspectorClient::releaseFrontend): Deleted.

  • WebView/WebView.mm:

(-[WebView setShowingInspectorIndication:]):

  • WebView/WebViewPrivate.h:

Renamed methods.

Source/WebKit2:

  • UIProcess/ios/WKContentView.h:
  • UIProcess/ios/WKContentView.mm:

(-[WKInspectorIndicationView initWithFrame:]):
(-[WKContentView isShowingInspectorIndication]):
(-[WKContentView setShowingInspectorIndication:]):
(-[WKContentView _didCommitLayerTree:WebKit::]):
When indicating include a simple tinted UIView over the content.

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _showInspectorIndication]):
(-[WKWebView _hideInspectorIndication]):
Have the content view show or hide an indication.

  • UIProcess/PageClient.h:
  • UIProcess/ios/PageClientImplIOS.h:
  • UIProcess/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::showInspectorIndication):
(WebKit::PageClientImpl::hideInspectorIndication):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::showInspectorIndication):
(WebKit::WebPageProxy::hideInspectorIndication):
Pass WebProcess indication message up to the WKWebView.

  • WebProcess/WebCoreSupport/WebInspectorClient.cpp:

(WebKit::WebInspectorClient::indicate):
(WebKit::WebInspectorClient::hideIndication):

  • WebProcess/WebCoreSupport/WebInspectorClient.h:
  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::indicate):
(WebKit::WebPage::hideIndication):
Pass WebCore / remote inspector indication message up to UIProcess.

Location:
trunk/Source
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166256 r166257  
     12014-03-25  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Inspector View Indication Support
     4        https://bugs.webkit.org/show_bug.cgi?id=130709
     5
     6        Reviewed by Simon Fraser.
     7
     8        * inspector/InspectorClient.h:
     9        (WebCore::InspectorClient::showInspectorIndication):
     10        (WebCore::InspectorClient::hideInspectorIndication):
     11        * inspector/InspectorController.cpp:
     12        (WebCore::InspectorController::setIndicating):
     13        Rename indicate/hideIndication to show/hide names.
     14
    1152014-03-25  Brent Fulgham  <bfulgham@apple.com>
    216
  • trunk/Source/WebCore/inspector/InspectorClient.h

    r165676 r166257  
    5757    virtual void hideHighlight() = 0;
    5858
    59     virtual void indicate() { }
    60     virtual void hideIndication() { }
     59    virtual void showInspectorIndication() { }
     60    virtual void hideInspectorIndication() { }
    6161
    6262    virtual bool canClearBrowserCache() { return false; }
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r165545 r166257  
    375375#else
    376376    if (indicating)
    377         m_inspectorClient->indicate();
     377        m_inspectorClient->showInspectorIndication();
    378378    else
    379         m_inspectorClient->hideIndication();
     379        m_inspectorClient->hideInspectorIndication();
    380380#endif
    381381}
  • trunk/Source/WebKit/ios/ChangeLog

    r166120 r166257  
     12014-03-25  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Inspector View Indication Support
     4        https://bugs.webkit.org/show_bug.cgi?id=130709
     5
     6        Reviewed by Simon Fraser.
     7
     8        * WebCoreSupport/WebInspectorClientIOS.mm:
     9        (WebInspectorClient::showInspectorIndication):
     10        (WebInspectorClient::hideInspectorIndication):
     11        Renamed methods.
     12
    1132014-03-22  Darin Adler  <darin@apple.com>
    214
  • trunk/Source/WebKit/ios/WebCoreSupport/WebInspectorClientIOS.mm

    r165676 r166257  
    8888}
    8989
    90 void WebInspectorClient::indicate()
     90void WebInspectorClient::showInspectorIndication()
    9191{
    92     [m_webView setIndicatingForRemoteInspector:YES];
     92    [m_webView setShowingInspectorIndication:YES];
    9393}
    9494
    95 void WebInspectorClient::hideIndication()
     95void WebInspectorClient::hideInspectorIndication()
    9696{
    97     [m_webView setIndicatingForRemoteInspector:NO];
     97    [m_webView setShowingInspectorIndication:NO];
    9898}
    9999
  • trunk/Source/WebKit/mac/ChangeLog

    r166201 r166257  
     12014-03-25  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Inspector View Indication Support
     4        https://bugs.webkit.org/show_bug.cgi?id=130709
     5
     6        Reviewed by Simon Fraser.
     7
     8        * WebCoreSupport/WebInspectorClient.h:
     9        * WebCoreSupport/WebInspectorClient.mm:
     10        (WebInspectorClient::didSetSearchingForNode): Deleted.
     11        (WebInspectorClient::releaseFrontend): Deleted.
     12        * WebView/WebView.mm:
     13        (-[WebView setShowingInspectorIndication:]):
     14        * WebView/WebViewPrivate.h:
     15        Renamed methods.
     16
    1172014-03-24  Brent Fulgham  <bfulgham@apple.com>
    218
  • trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h

    r165676 r166257  
    7474    virtual void hideHighlight() override;
    7575
    76     virtual void indicate() override;
    77     virtual void hideIndication() override;
     76#if PLATFORM(IOS)
     77    virtual void showInspectorIndication() override;
     78    virtual void hideInspectorIndication() override;
     79#endif
    7880
    7981    virtual void didSetSearchingForNode(bool) override;
  • trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm

    r165676 r166257  
    182182}
    183183
    184 void WebInspectorClient::indicate()
    185 {
    186 #if ENABLE(REMOTE_INSPECTOR)
    187     [m_webView setIndicatingForRemoteInspector:YES];
    188 #endif
    189 }
    190 
    191 void WebInspectorClient::hideIndication()
    192 {
    193 #if ENABLE(REMOTE_INSPECTOR)
    194     [m_webView setIndicatingForRemoteInspector:NO];
    195 #endif
    196 }
    197 
    198184void WebInspectorClient::didSetSearchingForNode(bool enabled)
    199185{
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r166117 r166257  
    18941894}
    18951895
    1896 - (void)setIndicatingForRemoteInspector:(BOOL)enabled
     1896- (void)setShowingInspectorIndication:(BOOL)showing
    18971897{
    18981898#if PLATFORM(IOS)
    18991899    ASSERT(WebThreadIsLocked());
    19001900
    1901     if (enabled) {
     1901    if (showing) {
    19021902        if (!_private->indicateLayer) {
    19031903            _private->indicateLayer = [[WebIndicateLayer alloc] initWithWebView:self];
     
    19111911    }
    19121912#else
    1913     // FIXME: Needs implementation or put an implementation in WebCore::InspectorOverlay.
     1913    // Implemented in WebCore::InspectorOverlay.
    19141914#endif
    19151915}
  • trunk/Source/WebKit/mac/WebView/WebViewPrivate.h

    r166117 r166257  
    320320
    321321/*!
    322     @method setIndicatingForRemoteInspector
     322    @method setShowingInspectorIndication
    323323    @param enabled Show the indication when true, hide when false.
    324324    @abstract indicate this WebView on screen for a remote inspector.
    325325*/
    326 - (void)setIndicatingForRemoteInspector:(BOOL)enabled;
     326- (void)setShowingInspectorIndication:(BOOL)enabled;
    327327
    328328#if TARGET_OS_IPHONE
  • trunk/Source/WebKit2/ChangeLog

    r166253 r166257  
     12014-03-25  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Inspector View Indication Support
     4        https://bugs.webkit.org/show_bug.cgi?id=130709
     5
     6        Reviewed by Simon Fraser.
     7
     8        * UIProcess/ios/WKContentView.h:
     9        * UIProcess/ios/WKContentView.mm:
     10        (-[WKInspectorIndicationView initWithFrame:]):
     11        (-[WKContentView isShowingInspectorIndication]):
     12        (-[WKContentView setShowingInspectorIndication:]):
     13        (-[WKContentView _didCommitLayerTree:WebKit::]):
     14        When indicating include a simple tinted UIView over the content.
     15
     16        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
     17        * UIProcess/API/Cocoa/WKWebView.mm:
     18        (-[WKWebView _showInspectorIndication]):
     19        (-[WKWebView _hideInspectorIndication]):
     20        Have the content view show or hide an indication.
     21
     22        * UIProcess/PageClient.h:
     23        * UIProcess/ios/PageClientImplIOS.h:
     24        * UIProcess/ios/PageClientImplIOS.mm:
     25        (WebKit::PageClientImpl::showInspectorIndication):
     26        (WebKit::PageClientImpl::hideInspectorIndication):
     27        * UIProcess/WebPageProxy.h:
     28        * UIProcess/WebPageProxy.messages.in:
     29        * UIProcess/ios/WebPageProxyIOS.mm:
     30        (WebKit::WebPageProxy::showInspectorIndication):
     31        (WebKit::WebPageProxy::hideInspectorIndication):
     32        Pass WebProcess indication message up to the WKWebView.
     33
     34        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
     35        (WebKit::WebInspectorClient::indicate):
     36        (WebKit::WebInspectorClient::hideIndication):
     37        * WebProcess/WebCoreSupport/WebInspectorClient.h:
     38        * WebProcess/WebPage/WebPage.h:
     39        * WebProcess/WebPage/ios/WebPageIOS.mm:
     40        (WebKit::WebPage::indicate):
     41        (WebKit::WebPage::hideIndication):
     42        Pass WebCore / remote inspector indication message up to UIProcess.
     43
    1442014-03-25  Anders Carlsson  <andersca@apple.com>
    245
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r166251 r166257  
    7070- (CGFloat)getVerticalOverlapForView:(UIView *)view usingKeyboardInfo:(NSDictionary *)info;
    7171@end
    72 
    7372#endif
    7473
     
    11111110}
    11121111
     1112- (void)_showInspectorIndication
     1113{
     1114    [_contentView setShowingInspectorIndication:YES];
     1115}
     1116
     1117- (void)_hideInspectorIndication
     1118{
     1119    [_contentView setShowingInspectorIndication:NO];
     1120}
     1121
    11131122- (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler
    11141123{
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r166017 r166257  
    9191- (void)_endInteractiveObscuredInsetsChange;
    9292
     93- (void)_showInspectorIndication;
     94- (void)_hideInspectorIndication;
     95
    9396- (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler;
    9497#else
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r165356 r166257  
    250250    virtual void saveImageToLibrary(PassRefPtr<WebCore::SharedBuffer>) = 0;
    251251    virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
     252
     253#if ENABLE(INSPECTOR)
     254    virtual void showInspectorIndication() = 0;
     255    virtual void hideInspectorIndication() = 0;
     256#endif
    252257#endif
    253258
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r166208 r166257  
    13261326    void startAssistingNode(const AssistedNodeInformation&);
    13271327    void stopAssistingNode();
     1328
     1329#if ENABLE(INSPECTOR)
     1330    void showInspectorIndication();
     1331    void hideInspectorIndication();
     1332#endif
     1333
    13281334    void notifyRevealedSelection();
    13291335#endif // PLATFORM(IOS)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r166208 r166257  
    320320    StopAssistingNode()
    321321    NotifyRevealedSelection()
     322
     323#if ENABLE(INSPECTOR)
     324    ShowInspectorIndication()
     325    HideInspectorIndication()
     326#endif
    322327#endif
    323328
  • trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h

    r165356 r166257  
    115115    virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);
    116116
     117#if ENABLE(INSPECTOR)
     118    virtual void showInspectorIndication() override;
     119    virtual void hideInspectorIndication() override;
     120#endif
     121
    117122    // Auxiliary Client Creation
    118123#if ENABLE(FULLSCREEN_API)
  • trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm

    r165356 r166257  
    364364}
    365365
     366#if ENABLE(INSPECTOR)
     367void PageClientImpl::showInspectorIndication()
     368{
     369    [m_webView _showInspectorIndication];
     370}
     371
     372void PageClientImpl::hideInspectorIndication()
     373{
     374    [m_webView _hideInspectorIndication];
     375}
     376#endif
     377
    366378#if ENABLE(FULLSCREEN_API)
    367379
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.h

    r165022 r166257  
    5454@property (nonatomic, readonly) WebKit::WebPageProxy* page;
    5555@property (nonatomic, readonly) BOOL isAssistingNode;
     56@property (nonatomic, getter=isShowingInspectorIndication) BOOL showingInspectorIndication;
    5657
    5758- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r166188 r166257  
    131131} // namespace WebKit
    132132
     133@interface WKInspectorIndicationView : UIView
     134@end
     135
     136@implementation WKInspectorIndicationView
     137
     138- (instancetype)initWithFrame:(CGRect)frame
     139{
     140    if (!(self = [super initWithFrame:frame]))
     141        return nil;
     142    self.userInteractionEnabled = NO;
     143    self.backgroundColor = [UIColor colorWithRed:(111.0 / 255.0) green:(168.0 / 255.0) blue:(220.0 / 255.0) alpha:0.66f];
     144    return self;
     145}
     146
     147@end
     148
    133149@implementation WKContentView {
    134150    std::unique_ptr<PageClientImpl> _pageClient;
     
    136152
    137153    RetainPtr<UIView> _rootContentView;
     154    RetainPtr<WKInspectorIndicationView> _inspectorIndicationView;
    138155
    139156    WKWebView *_webView;
     
    234251{
    235252    return [self isEditable];
     253}
     254
     255- (BOOL)isShowingInspectorIndication
     256{
     257    return !!_inspectorIndicationView;
     258}
     259
     260- (void)setShowingInspectorIndication:(BOOL)show
     261{
     262    if (show) {
     263        if (!_inspectorIndicationView) {
     264            _inspectorIndicationView = adoptNS([[WKInspectorIndicationView alloc] initWithFrame:[self bounds]]);
     265            [self insertSubview:_inspectorIndicationView.get() aboveSubview:_rootContentView.get()];
     266        }
     267    } else {
     268        if (_inspectorIndicationView) {
     269            [_inspectorIndicationView removeFromSuperview];
     270            _inspectorIndicationView = nil;
     271        }
     272    }
    236273}
    237274
     
    371408    [self setBounds:{CGPointZero, contentsSize}];
    372409    [_rootContentView setFrame:CGRectMake(0, 0, contentsSize.width, contentsSize.height)];
     410    [_inspectorIndicationView setFrame:[self bounds]];
    373411
    374412    [_webView _didCommitLayerTree:layerTreeTransaction];
  • trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm

    r166208 r166257  
    478478}
    479479
     480#if ENABLE(INSPECTOR)
     481void WebPageProxy::showInspectorIndication()
     482{
     483    m_pageClient.showInspectorIndication();
     484}
     485
     486void WebPageProxy::hideInspectorIndication()
     487{
     488    m_pageClient.hideInspectorIndication();
     489}
     490#endif
     491
    480492void WebPageProxy::focusNextAssistedNode(bool isForward)
    481493{
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp

    r164830 r166257  
    9898}
    9999
     100#if PLATFORM(IOS)
     101void WebInspectorClient::showInspectorIndication()
     102{
     103    m_page->showInspectorIndication();
     104}
     105
     106void WebInspectorClient::hideInspectorIndication()
     107{
     108    m_page->hideInspectorIndication();
     109}
     110#endif
     111
    100112bool WebInspectorClient::sendMessageToFrontend(const String& message)
    101113{
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h

    r162139 r166257  
    6666    virtual void hideHighlight() override;
    6767
     68#if PLATFORM(IOS)
     69    virtual void showInspectorIndication() override;
     70    virtual void hideInspectorIndication() override;
     71#endif
     72
    6873    virtual bool sendMessageToFrontend(const String&) override;
    6974
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r166208 r166257  
    469469    void setAssistedNodeValueAsNumber(double);
    470470    void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
     471
     472#if ENABLE(INSPECTOR)
     473    void showInspectorIndication();
     474    void hideInspectorIndication();
     475#endif
    471476#endif
    472477
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r166208 r166257  
    371371}
    372372
     373#if ENABLE(INSPECTOR)
     374void WebPage::showInspectorIndication()
     375{
     376    send(Messages::WebPageProxy::ShowInspectorIndication());
     377}
     378
     379void WebPage::hideInspectorIndication()
     380{
     381    send(Messages::WebPageProxy::HideInspectorIndication());
     382}
     383#endif
     384
    373385static FloatQuad innerFrameQuad(Frame* frame, Node* assistedNode)
    374386{
Note: See TracChangeset for help on using the changeset viewer.