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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166257
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-25 Joseph Pecoraro <pecoraro@apple.com>
+
+ [iOS] Inspector View Indication Support
+ https://bugs.webkit.org/show_bug.cgi?id=130709
+
+ Reviewed by Simon Fraser.
+
+ * inspector/InspectorClient.h:
+ (WebCore::InspectorClient::showInspectorIndication):
+ (WebCore::InspectorClient::hideInspectorIndication):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::setIndicating):
+ Rename indicate/hideIndication to show/hide names.
+
2014-03-25 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix. Typo on checkin.
virtual void highlight() = 0;
virtual void hideHighlight() = 0;
- virtual void indicate() { }
- virtual void hideIndication() { }
+ virtual void showInspectorIndication() { }
+ virtual void hideInspectorIndication() { }
virtual bool canClearBrowserCache() { return false; }
virtual void clearBrowserCache() { }
m_overlay->setIndicating(indicating);
#else
if (indicating)
- m_inspectorClient->indicate();
+ m_inspectorClient->showInspectorIndication();
else
- m_inspectorClient->hideIndication();
+ m_inspectorClient->hideInspectorIndication();
#endif
}
+2014-03-25 Joseph Pecoraro <pecoraro@apple.com>
+
+ [iOS] Inspector View Indication Support
+ https://bugs.webkit.org/show_bug.cgi?id=130709
+
+ Reviewed by Simon Fraser.
+
+ * WebCoreSupport/WebInspectorClientIOS.mm:
+ (WebInspectorClient::showInspectorIndication):
+ (WebInspectorClient::hideInspectorIndication):
+ Renamed methods.
+
2014-03-22 Darin Adler <darin@apple.com>
Remove String::deprecatedCharacters
[m_highlighter.get() hideHighlight];
}
-void WebInspectorClient::indicate()
+void WebInspectorClient::showInspectorIndication()
{
- [m_webView setIndicatingForRemoteInspector:YES];
+ [m_webView setShowingInspectorIndication:YES];
}
-void WebInspectorClient::hideIndication()
+void WebInspectorClient::hideInspectorIndication()
{
- [m_webView setIndicatingForRemoteInspector:NO];
+ [m_webView setShowingInspectorIndication:NO];
}
void WebInspectorClient::didSetSearchingForNode(bool enabled)
+2014-03-25 Joseph Pecoraro <pecoraro@apple.com>
+
+ [iOS] Inspector View Indication Support
+ https://bugs.webkit.org/show_bug.cgi?id=130709
+
+ Reviewed by Simon Fraser.
+
+ * WebCoreSupport/WebInspectorClient.h:
+ * WebCoreSupport/WebInspectorClient.mm:
+ (WebInspectorClient::didSetSearchingForNode): Deleted.
+ (WebInspectorClient::releaseFrontend): Deleted.
+ * WebView/WebView.mm:
+ (-[WebView setShowingInspectorIndication:]):
+ * WebView/WebViewPrivate.h:
+ Renamed methods.
+
2014-03-24 Brent Fulgham <bfulgham@apple.com>
Activate WebVTT Tests Once Merging is Complete
virtual void highlight() override;
virtual void hideHighlight() override;
- virtual void indicate() override;
- virtual void hideIndication() override;
+#if PLATFORM(IOS)
+ virtual void showInspectorIndication() override;
+ virtual void hideInspectorIndication() override;
+#endif
virtual void didSetSearchingForNode(bool) override;
[m_highlighter.get() hideHighlight];
}
-void WebInspectorClient::indicate()
-{
-#if ENABLE(REMOTE_INSPECTOR)
- [m_webView setIndicatingForRemoteInspector:YES];
-#endif
-}
-
-void WebInspectorClient::hideIndication()
-{
-#if ENABLE(REMOTE_INSPECTOR)
- [m_webView setIndicatingForRemoteInspector:NO];
-#endif
-}
-
void WebInspectorClient::didSetSearchingForNode(bool enabled)
{
WebInspector *inspector = [m_webView inspector];
_private->page->setRemoteInspectionAllowed(allow);
}
-- (void)setIndicatingForRemoteInspector:(BOOL)enabled
+- (void)setShowingInspectorIndication:(BOOL)showing
{
#if PLATFORM(IOS)
ASSERT(WebThreadIsLocked());
- if (enabled) {
+ if (showing) {
if (!_private->indicateLayer) {
_private->indicateLayer = [[WebIndicateLayer alloc] initWithWebView:self];
[_private->indicateLayer setNeedsLayout];
_private->indicateLayer = nil;
}
#else
- // FIXME: Needs implementation or put an implementation in WebCore::InspectorOverlay.
+ // Implemented in WebCore::InspectorOverlay.
#endif
}
- (void)setAllowsRemoteInspection:(BOOL)allow;
/*!
- @method setIndicatingForRemoteInspector
+ @method setShowingInspectorIndication
@param enabled Show the indication when true, hide when false.
@abstract indicate this WebView on screen for a remote inspector.
*/
-- (void)setIndicatingForRemoteInspector:(BOOL)enabled;
+- (void)setShowingInspectorIndication:(BOOL)enabled;
#if TARGET_OS_IPHONE
/*!
+2014-03-25 Joseph Pecoraro <pecoraro@apple.com>
+
+ [iOS] Inspector View Indication Support
+ https://bugs.webkit.org/show_bug.cgi?id=130709
+
+ Reviewed by Simon Fraser.
+
+ * 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.
+
2014-03-25 Anders Carlsson <andersca@apple.com>
Add more properties to WKWindowFeatures
@interface UIPeripheralHost(UIKitInternal)
- (CGFloat)getVerticalOverlapForView:(UIView *)view usingKeyboardInfo:(NSDictionary *)info;
@end
-
#endif
#if PLATFORM(MAC)
[self _updateVisibleContentRects];
}
+- (void)_showInspectorIndication
+{
+ [_contentView setShowingInspectorIndication:YES];
+}
+
+- (void)_hideInspectorIndication
+{
+ [_contentView setShowingInspectorIndication:NO];
+}
+
- (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler
{
CGRect snapshotRectInContentCoordinates = [self convertRect:rectInViewCoordinates toView:_contentView.get()];
- (void)_beginInteractiveObscuredInsetsChange;
- (void)_endInteractiveObscuredInsetsChange;
+- (void)_showInspectorIndication;
+- (void)_hideInspectorIndication;
+
- (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler;
#else
@property (readonly) NSColor *_pageExtendedBackgroundColor;
virtual void positionInformationDidChange(const InteractionInformationAtPosition&) = 0;
virtual void saveImageToLibrary(PassRefPtr<WebCore::SharedBuffer>) = 0;
virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
+
+#if ENABLE(INSPECTOR)
+ virtual void showInspectorIndication() = 0;
+ virtual void hideInspectorIndication() = 0;
+#endif
#endif
// Auxiliary Client Creation
void startAssistingNode(const AssistedNodeInformation&);
void stopAssistingNode();
+
+#if ENABLE(INSPECTOR)
+ void showInspectorIndication();
+ void hideInspectorIndication();
+#endif
+
void notifyRevealedSelection();
#endif // PLATFORM(IOS)
StartAssistingNode(WebKit::AssistedNodeInformation information)
StopAssistingNode()
NotifyRevealedSelection()
+
+#if ENABLE(INSPECTOR)
+ ShowInspectorIndication()
+ HideInspectorIndication()
+#endif
#endif
# Search popup menus
virtual void saveImageToLibrary(PassRefPtr<WebCore::SharedBuffer>);
virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);
+#if ENABLE(INSPECTOR)
+ virtual void showInspectorIndication() override;
+ virtual void hideInspectorIndication() override;
+#endif
+
// Auxiliary Client Creation
#if ENABLE(FULLSCREEN_API)
virual WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() override;
[m_contentView _didUpdateBlockSelectionWithTouch:(WKSelectionTouch)touch withFlags:(WKSelectionFlags)flags growThreshold:growThreshold shrinkThreshold:shrinkThreshold];
}
+#if ENABLE(INSPECTOR)
+void PageClientImpl::showInspectorIndication()
+{
+ [m_webView _showInspectorIndication];
+}
+
+void PageClientImpl::hideInspectorIndication()
+{
+ [m_webView _hideInspectorIndication];
+}
+#endif
+
#if ENABLE(FULLSCREEN_API)
WebFullScreenManagerProxyClient& PageClientImpl::fullScreenManagerProxyClient()
@property (nonatomic, readonly) WebKit::WebPageProxy* page;
@property (nonatomic, readonly) BOOL isAssistingNode;
+@property (nonatomic, getter=isShowingInspectorIndication) BOOL showingInspectorIndication;
- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
};
} // namespace WebKit
+@interface WKInspectorIndicationView : UIView
+@end
+
+@implementation WKInspectorIndicationView
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ if (!(self = [super initWithFrame:frame]))
+ return nil;
+ self.userInteractionEnabled = NO;
+ self.backgroundColor = [UIColor colorWithRed:(111.0 / 255.0) green:(168.0 / 255.0) blue:(220.0 / 255.0) alpha:0.66f];
+ return self;
+}
+
+@end
+
@implementation WKContentView {
std::unique_ptr<PageClientImpl> _pageClient;
RetainPtr<WKBrowsingContextController> _browsingContextController;
RetainPtr<UIView> _rootContentView;
+ RetainPtr<WKInspectorIndicationView> _inspectorIndicationView;
WKWebView *_webView;
return [self isEditable];
}
+- (BOOL)isShowingInspectorIndication
+{
+ return !!_inspectorIndicationView;
+}
+
+- (void)setShowingInspectorIndication:(BOOL)show
+{
+ if (show) {
+ if (!_inspectorIndicationView) {
+ _inspectorIndicationView = adoptNS([[WKInspectorIndicationView alloc] initWithFrame:[self bounds]]);
+ [self insertSubview:_inspectorIndicationView.get() aboveSubview:_rootContentView.get()];
+ }
+ } else {
+ if (_inspectorIndicationView) {
+ [_inspectorIndicationView removeFromSuperview];
+ _inspectorIndicationView = nil;
+ }
+ }
+}
+
static inline FloatRect fixedPositionRectFromExposedRect(CGRect unobscuredRect, CGSize documentSize, CGFloat scale)
{
return FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(unobscuredRect), roundedLayoutSize(FloatSize(documentSize)), scale, false, StickToViewportBounds);
[self setBounds:{CGPointZero, contentsSize}];
[_rootContentView setFrame:CGRectMake(0, 0, contentsSize.width, contentsSize.height)];
+ [_inspectorIndicationView setFrame:[self bounds]];
[_webView _didCommitLayerTree:layerTreeTransaction];
[self _updateChangedSelection];
m_pageClient.stopAssistingNode();
}
+#if ENABLE(INSPECTOR)
+void WebPageProxy::showInspectorIndication()
+{
+ m_pageClient.showInspectorIndication();
+}
+
+void WebPageProxy::hideInspectorIndication()
+{
+ m_pageClient.hideInspectorIndication();
+}
+#endif
+
void WebPageProxy::focusNextAssistedNode(bool isForward)
{
process().send(Messages::WebPage::FocusNextAssistedNode(isForward), m_pageID);
m_page->uninstallPageOverlay(m_highlightOverlay, true);
}
+#if PLATFORM(IOS)
+void WebInspectorClient::showInspectorIndication()
+{
+ m_page->showInspectorIndication();
+}
+
+void WebInspectorClient::hideInspectorIndication()
+{
+ m_page->hideInspectorIndication();
+}
+#endif
+
bool WebInspectorClient::sendMessageToFrontend(const String& message)
{
WebInspector* inspector = m_page->inspector();
virtual void highlight() override;
virtual void hideHighlight() override;
+#if PLATFORM(IOS)
+ virtual void showInspectorIndication() override;
+ virtual void hideInspectorIndication() override;
+#endif
+
virtual bool sendMessageToFrontend(const String&) override;
virtual bool supportsFrameInstrumentation();
void setAssistedNodeValue(const String&);
void setAssistedNodeValueAsNumber(double);
void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
+
+#if ENABLE(INSPECTOR)
+ void showInspectorIndication();
+ void hideInspectorIndication();
+#endif
#endif
NotificationPermissionRequestManager* notificationPermissionRequestManager();
select->optionSelectedByUser(index, true, allowMultipleSelection);
}
+#if ENABLE(INSPECTOR)
+void WebPage::showInspectorIndication()
+{
+ send(Messages::WebPageProxy::ShowInspectorIndication());
+}
+
+void WebPage::hideInspectorIndication()
+{
+ send(Messages::WebPageProxy::HideInspectorIndication());
+}
+#endif
+
static FloatQuad innerFrameQuad(Frame* frame, Node* assistedNode)
{
frame->document()->updateLayoutIgnorePendingStylesheets();