Title: [175122] branches/safari-600.3-branch/Source/WebKit2
Revision
175122
Author
[email protected]
Date
2014-10-23 09:09:46 -0700 (Thu, 23 Oct 2014)

Log Message

Merge r175016. <rdar://problem/18731860>

Modified Paths

Diff

Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (175121 => 175122)


--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-10-23 15:56:41 UTC (rev 175121)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-10-23 16:09:46 UTC (rev 175122)
@@ -1,5 +1,21 @@
 2014-10-23  Matthew Hanson  <[email protected]>
 
+        Merge r175016. <rdar://problem/18731860>
+
+    2014-10-21  Tim Horton  <[email protected]>
+    
+            Quick Look preview bubble has unnecessary controls
+            https://bugs.webkit.org/show_bug.cgi?id=137940
+            <rdar://problem/18731860>
+    
+            Reviewed by Simon Fraser.
+    
+            * UIProcess/API/mac/WKView.mm:
+            (-[WKView _quickLookURLFromActionMenu:]):
+            Temporarily use more SPI to allow us to hide the preview bubble's controls.
+    
+2014-10-23  Matthew Hanson  <[email protected]>
+
         Merge r174913. <rdar://problem/18712808>
 
     2014-10-20  Beth Dakin  <[email protected]>

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (175121 => 175122)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-10-23 15:56:41 UTC (rev 175121)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-10-23 16:09:46 UTC (rev 175122)
@@ -119,8 +119,14 @@
 - (void)_maskRoundedBottomCorners:(NSRect)clipRect;
 @end
 
+@class QLPreviewBubble;
 @interface NSObject (WKQLPreviewBubbleDetails)
-+ (void)presentBubbleForItem:(id)item parentWindow:(NSWindow *)aWindow itemFrame:(NSRect)itemFrame maximumSize:(NSSize)maximumSize preferredEdge:(NSRectEdge)preferredEdge;
+@property (copy) NSArray * controls;
+@property NSSize maximumSize;
+@property NSRectEdge preferredEdge;
+@property (retain) IBOutlet NSWindow* parentWindow;
+- (void)showPreviewItem:(id)previewItem itemFrame:(NSRect)frame;
+- (void)setAutomaticallyCloseWithMask:(NSEventMask)autocloseMask filterMask:(NSEventMask)filterMask block:(void (^)(void))block;
 @end
 
 #if USE(ASYNC_NSTEXTINPUTCLIENT)
@@ -3663,8 +3669,17 @@
     NSRect itemFrame = [self convertRect:hitTestResult->elementBoundingBox() toView:nil];
     NSSize maximumPreviewSize = NSMakeSize(self.bounds.size.width * 0.75, self.bounds.size.height * 0.75);
 
-    NSURL *url = "" URLWithString:hitTestResult->absoluteLinkURL()];
-    [NSClassFromString(@"QLPreviewBubble") presentBubbleForItem:url parentWindow:self.window itemFrame:itemFrame maximumSize:maximumPreviewSize preferredEdge:NSMaxYEdge];
+    RetainPtr<QLPreviewBubble> bubble = adoptNS([[NSClassFromString(@"QLPreviewBubble") alloc] init]);
+    [bubble setParentWindow:self.window];
+    [bubble setMaximumSize:maximumPreviewSize];
+    [bubble setPreferredEdge:NSMaxYEdge];
+    [bubble setControls:@[ ]];
+    NSEventMask filterMask = NSAnyEventMask & ~(NSAppKitDefinedMask | NSSystemDefinedMask | NSApplicationDefinedMask | NSMouseEnteredMask | NSMouseExitedMask);
+    NSEventMask autocloseMask = NSLeftMouseDownMask | NSRightMouseDownMask | NSKeyDownMask;
+    [bubble setAutomaticallyCloseWithMask:autocloseMask filterMask:filterMask block:[bubble] {
+        [bubble close];
+    }];
+    [bubble showPreviewItem:[NSURL URLWithString:hitTestResult->absoluteLinkURL()] itemFrame:itemFrame];
 }
 
 - (NSArray *)_defaultMenuItemsForLink
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to