Title: [166409] trunk/Source/WebKit/ios
Revision
166409
Author
[email protected]
Date
2014-03-28 09:18:01 -0700 (Fri, 28 Mar 2014)

Log Message

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:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ios/ChangeLog (166408 => 166409)


--- trunk/Source/WebKit/ios/ChangeLog	2014-03-28 15:49:39 UTC (rev 166408)
+++ trunk/Source/WebKit/ios/ChangeLog	2014-03-28 16:18:01 UTC (rev 166409)
@@ -1,5 +1,26 @@
 2014-03-27  Enrica Casucci  <[email protected]>
 
+        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  <[email protected]>
+
         Add support for AirPlay picker in WK2 for iOS.
         https://bugs.webkit.org/show_bug.cgi?id=130855
         <rdar://problem/15349859>

Modified: trunk/Source/WebKit/ios/DefaultDelegates/WebDefaultUIKitDelegate.m (166408 => 166409)


--- trunk/Source/WebKit/ios/DefaultDelegates/WebDefaultUIKitDelegate.m	2014-03-28 15:49:39 UTC (rev 166408)
+++ trunk/Source/WebKit/ios/DefaultDelegates/WebDefaultUIKitDelegate.m	2014-03-28 16:18:01 UTC (rev 166409)
@@ -236,6 +236,15 @@
     return nil; 
 } 
 
+- (CGPoint)interactionLocation
+{
+    return CGPointZero;
+}
+
+- (void)showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(CGRect)elementRect
+{
+}
+
 - (BOOL)hasRichlyEditableSelection
 {
     return NO;

Modified: trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm (166408 => 166409)


--- trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm	2014-03-28 15:49:39 UTC (rev 166408)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm	2014-03-28 16:18:01 UTC (rev 166409)
@@ -316,6 +316,9 @@
 
 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)

Modified: trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.h (166408 => 166409)


--- trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.h	2014-03-28 15:49:39 UTC (rev 166408)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.h	2014-03-28 16:18:01 UTC (rev 166409)
@@ -93,6 +93,7 @@
 - (WebVisiblePosition *)previousUnperturbedDictationResultBoundaryFromPosition:(WebVisiblePosition *)position;
 - (WebVisiblePosition *)nextUnperturbedDictationResultBoundaryFromPosition:(WebVisiblePosition *)position;
 
+- (CGRect)elementRectAtPoint:(CGPoint)point;
 @end
 
 #endif // TARGET_OS_IPHONE

Modified: trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm (166408 => 166409)


--- trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm	2014-03-28 15:49:39 UTC (rev 166408)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm	2014-03-28 16:18:01 UTC (rev 166409)
@@ -943,6 +943,17 @@
     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)

Modified: trunk/Source/WebKit/ios/WebView/WebUIKitDelegate.h (166408 => 166409)


--- trunk/Source/WebKit/ios/WebView/WebUIKitDelegate.h	2014-03-28 15:49:39 UTC (rev 166408)
+++ trunk/Source/WebKit/ios/WebView/WebUIKitDelegate.h	2014-03-28 16:18:01 UTC (rev 166409)
@@ -108,6 +108,8 @@
 - (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;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to