https://bugs.webkit.org/show_bug.cgi?id=130876
<rdar://problem/
15349859>
Reviewed by Benjamin Poulain.
Adds support for the AirPlay picker for WebKit.
The actual picker is implemented in UIKit.
* DefaultDelegates/WebDefaultUIKitDelegate.m:
(-[WebDefaultUIKitDelegate interactionLocation]):
(-[WebDefaultUIKitDelegate showPlaybackTargetPicker:fromRect:]):
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::showPlaybackTargetPicker):
* WebCoreSupport/WebFrameIOS.h:
* WebCoreSupport/WebFrameIOS.mm:
(-[WebFrame elementRectAtPoint:]):
* WebView/WebUIKitDelegate.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166409
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-27 Enrica Casucci <enrica@apple.com>
+
+ Add support for AirPlay picker for iOS.
+ https://bugs.webkit.org/show_bug.cgi?id=130876
+ <rdar://problem/15349859>
+
+ Reviewed by Benjamin Poulain.
+
+ Adds support for the AirPlay picker for WebKit.
+ The actual picker is implemented in UIKit.
+
+ * DefaultDelegates/WebDefaultUIKitDelegate.m:
+ (-[WebDefaultUIKitDelegate interactionLocation]):
+ (-[WebDefaultUIKitDelegate showPlaybackTargetPicker:fromRect:]):
+ * WebCoreSupport/WebChromeClientIOS.mm:
+ (WebChromeClientIOS::showPlaybackTargetPicker):
+ * WebCoreSupport/WebFrameIOS.h:
+ * WebCoreSupport/WebFrameIOS.mm:
+ (-[WebFrame elementRectAtPoint:]):
+ * WebView/WebUIKitDelegate.h:
+
2014-03-27 Enrica Casucci <enrica@apple.com>
Add support for AirPlay picker in WK2 for iOS.
return nil;
}
+- (CGPoint)interactionLocation
+{
+ return CGPointZero;
+}
+
+- (void)showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(CGRect)elementRect
+{
+}
+
- (BOOL)hasRichlyEditableSelection
{
return NO;
void WebChromeClientIOS::showPlaybackTargetPicker(bool hasVideo)
{
+ CGPoint point = [[webView() _UIKitDelegateForwarder] interactionLocation];
+ CGRect elementRect = [[webView() mainFrame] elementRectAtPoint:point];
+ [[webView() _UIKitDelegateForwarder] showPlaybackTargetPicker:hasVideo fromRect:elementRect];
}
#endif // PLATFORM(IOS)
- (WebVisiblePosition *)previousUnperturbedDictationResultBoundaryFromPosition:(WebVisiblePosition *)position;
- (WebVisiblePosition *)nextUnperturbedDictationResultBoundaryFromPosition:(WebVisiblePosition *)position;
+- (CGRect)elementRectAtPoint:(CGPoint)point;
@end
#endif // TARGET_OS_IPHONE
return position;
}
+- (CGRect)elementRectAtPoint:(CGPoint)point
+{
+ Frame *frame = [self coreFrame];
+ IntPoint adjustedPoint = frame->view()->windowToContents(roundedIntPoint(point));
+ HitTestResult result = frame->eventHandler().hitTestResultAtPoint(adjustedPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent);
+ Node* hitNode = result.innerNode();
+ if (!hitNode || !hitNode->renderer())
+ return IntRect();
+ return result.innerNodeFrame()->view()->contentsToWindow(hitNode->renderer()->absoluteBoundingBoxRect(true));
+}
+
@end
#endif // PLATFORM(IOS)
- (BOOL)hasRichlyEditableSelection;
- (BOOL)performsTwoStepPaste:(DOMDocumentFragment*)fragment;
- (NSInteger)getPasteboardChangeCount;
+- (CGPoint)interactionLocation;
+- (void)showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(CGRect)elementRect;
- (BOOL)isUnperturbedDictationResultMarker:(id)metadataForMarker;
- (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message withSource:(NSString *)source;