Yet another build fix.
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 21:53:06 +0000 (21:53 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 21:53:06 +0000 (21:53 +0000)
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForLink]):

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebActionMenuController.mm

index 5784610..fc78c85 100644 (file)
@@ -1,5 +1,12 @@
 2014-12-02  Beth Dakin  <bdakin@apple.com>
 
+        Yet another build fix.
+
+        * WebView/WebActionMenuController.mm:
+        (-[WebActionMenuController _defaultMenuItemsForLink]):
+
+2014-12-02  Beth Dakin  <bdakin@apple.com>
+
         Build fix.
 
         * WebView/WebActionMenuController.mm:
index a46fb9b..bbff7b2 100644 (file)
@@ -281,17 +281,19 @@ static IntRect elementBoundingBoxInWindowCoordinatesFromNode(Node* node)
 {
     RetainPtr<NSMenuItem> openLinkItem = [self _createActionMenuItemForTag:WebActionMenuItemTagOpenLinkInDefaultBrowser];
 
-    RetainPtr<QLPreviewMenuItem> previewLinkItem;
-    if ([NSMenuItem respondsToSelector:@selector(standardQuickLookMenuItem)]) {
-        previewLinkItem = [NSMenuItem standardQuickLookMenuItem];
-        [previewLinkItem setPreviewStyle:QLPreviewStylePopover];
-        [previewLinkItem setDelegate:self];
+    BOOL shouldUseStandardQuickLookPreview = [NSMenuItem respondsToSelector:@selector(standardQuickLookMenuItem)];
+    RetainPtr<NSMenuItem> previewLinkItem;
+    RetainPtr<QLPreviewMenuItem> qlPreviewLinkItem;
+    if (shouldUseStandardQuickLookPreview) {
+        qlPreviewLinkItem = [NSMenuItem standardQuickLookMenuItem];
+        [qlPreviewLinkItem setPreviewStyle:QLPreviewStylePopover];
+        [qlPreviewLinkItem setDelegate:self];
     } else
         previewLinkItem = [NSMenuItem separatorItem];
 
     RetainPtr<NSMenuItem> readingListItem = [self _createActionMenuItemForTag:WebActionMenuItemTagAddLinkToSafariReadingList];
 
-    return @[ openLinkItem.get(), previewLinkItem.get(), [NSMenuItem separatorItem], readingListItem.get() ];
+    return @[ openLinkItem.get(), shouldUseStandardQuickLookPreview ? qlPreviewLinkItem.get() : previewLinkItem.get(), [NSMenuItem separatorItem], readingListItem.get() ];
 }
 
 #pragma mark Mailto Link actions