REGRESSION (r191691): Unexpected "Share" context menu when right clicking around...
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Oct 2015 17:58:49 +0000 (17:58 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Oct 2015 17:58:49 +0000 (17:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150699
rdar://problem/23324522

Reviewed by Tim Horton.

Don't create a share menu item if we have nothing to share.

* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::createShareMenuItem):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm

index 5387ebd..e6b678b 100644 (file)
@@ -1,3 +1,16 @@
+2015-10-30  Anders Carlsson  <andersca@apple.com>
+
+        REGRESSION (r191691): Unexpected "Share" context menu when right clicking around inspector
+        https://bugs.webkit.org/show_bug.cgi?id=150699
+        rdar://problem/23324522
+
+        Reviewed by Tim Horton.
+
+        Don't create a share menu item if we have nothing to share.
+
+        * UIProcess/mac/WebContextMenuProxyMac.mm:
+        (WebKit::WebContextMenuProxyMac::createShareMenuItem):
+
 2015-10-30  Tim Horton  <timothy_horton@apple.com>
 
         Initialize some new WebViewImpl members
index 9587d67..e2c01d7 100644 (file)
@@ -282,6 +282,9 @@ RetainPtr<NSMenuItem> WebContextMenuProxyMac::createShareMenuItem()
         [items addObject:image.get()];
     }
 
+    if (![items count])
+        return nil;
+
     RetainPtr<NSMenuItem> item = [NSMenuItem standardShareMenuItemWithItems:items.get()];
     if (!item)
         return nil;