Title: [231803] branches/safari-606.1.17-branch/Source/WebKit
Revision
231803
Author
[email protected]
Date
2018-05-15 08:36:09 -0700 (Tue, 15 May 2018)

Log Message

Cherry-pick r231797. rdar://problem/39652624

    Update animation when presenting QuickLook
    https://bugs.webkit.org/show_bug.cgi?id=185648
    <rdar://problem/39652624>

    Reviewed by Antoine Quint.

    Implement the QuickLook delegate on _WKPreviewControllerDelegate that
    produces a zoom-like animation when the QLPreviewController appears.

    * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
    (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
    * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
    the delegate implementation can access the presentingViewController.
    (WebKit::SystemPreviewController::page):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231797 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-606.1.17-branch/Source/WebKit/ChangeLog (231802 => 231803)


--- branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-15 15:36:06 UTC (rev 231802)
+++ branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-15 15:36:09 UTC (rev 231803)
@@ -1,5 +1,43 @@
 2018-05-15  Babak Shafiei  <[email protected]>
 
+        Cherry-pick r231797. rdar://problem/39652624
+
+    Update animation when presenting QuickLook
+    https://bugs.webkit.org/show_bug.cgi?id=185648
+    <rdar://problem/39652624>
+    
+    Reviewed by Antoine Quint.
+    
+    Implement the QuickLook delegate on _WKPreviewControllerDelegate that
+    produces a zoom-like animation when the QLPreviewController appears.
+    
+    * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
+    (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
+    * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
+    the delegate implementation can access the presentingViewController.
+    (WebKit::SystemPreviewController::page):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-15  Dean Jackson  <[email protected]>
+
+            Update animation when presenting QuickLook
+            https://bugs.webkit.org/show_bug.cgi?id=185648
+            <rdar://problem/39652624>
+
+            Reviewed by Antoine Quint.
+
+            Implement the QuickLook delegate on _WKPreviewControllerDelegate that
+            produces a zoom-like animation when the QLPreviewController appears.
+
+            * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
+            (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
+            * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
+            the delegate implementation can access the presentingViewController.
+            (WebKit::SystemPreviewController::page):
+
+2018-05-15  Babak Shafiei  <[email protected]>
+
         Cherry-pick r231795. rdar://problem/40079228
 
     Download and present System Preview

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm (231802 => 231803)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm	2018-05-15 15:36:06 UTC (rev 231802)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm	2018-05-15 15:36:09 UTC (rev 231803)
@@ -126,6 +126,25 @@
     if (_previewController)
         _previewController->cancel();
 }
+
+- (CGRect)previewController:(QLPreviewController *)controller frameForPreviewItem:(id <QLPreviewItem>)item inSourceView:(UIView * *)view
+{
+    if (!_previewController)
+        return CGRectZero;
+
+    UIViewController *presentingViewController = _previewController->page().uiClient().presentingViewController();
+
+    if (!presentingViewController)
+        return CGRectZero;
+
+    CGRect frame = presentingViewController.view.frame;
+    // Create a smaller rectangle centered in the frame.
+    CGFloat halfWidth = frame.size.width / 2;
+    CGFloat halfHeight = frame.size.height / 2;
+    frame = CGRectMake(CGRectGetMidX(frame) - halfWidth / 2, CGRectGetMidY(frame) - halfHeight / 2, halfWidth, halfHeight);
+    return frame;
+}
+
 @end
 
 namespace WebKit {

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/SystemPreviewController.h (231802 => 231803)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/SystemPreviewController.h	2018-05-15 15:36:06 UTC (rev 231802)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/SystemPreviewController.h	2018-05-15 15:36:09 UTC (rev 231803)
@@ -51,6 +51,8 @@
     void finish(WebCore::URL);
     void cancel();
 
+    WebPageProxy& page() { return m_webPageProxy; }
+
 private:
     WebPageProxy& m_webPageProxy;
 #if USE(QUICK_LOOK)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to