Title: [172559] branches/safari-600.1-branch/Source/WebKit2
Revision
172559
Author
lforsch...@apple.com
Date
2014-08-13 20:53:04 -0700 (Wed, 13 Aug 2014)

Log Message

Merged r172498.  <rdar://problem/17996339>

Modified Paths

Diff

Modified: branches/safari-600.1-branch/Source/WebKit2/ChangeLog (172558 => 172559)


--- branches/safari-600.1-branch/Source/WebKit2/ChangeLog	2014-08-14 03:49:13 UTC (rev 172558)
+++ branches/safari-600.1-branch/Source/WebKit2/ChangeLog	2014-08-14 03:53:04 UTC (rev 172559)
@@ -1,5 +1,22 @@
 2014-08-13  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r172498
+
+    2014-08-12  Tim Horton  <timothy_hor...@apple.com>
+
+            REGRESSION (r172424): Extra menu header in combined telephone number menu when no phone paired
+            https://bugs.webkit.org/show_bug.cgi?id=135854
+            <rdar://problem/17996339>
+
+            Reviewed by Enrica Casucci.
+
+            * UIProcess/mac/WebContextMenuProxyMac.mm:
+            (WebKit::WebContextMenuProxyMac::setupServicesMenu):
+            Get all the menu items ahead of time, and only add the shared header
+            if there are any telephone number menu items.
+
+2014-08-13  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r172497
 
     2014-08-12  Enrica Casucci  <enr...@apple.com>

Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm (172558 => 172559)


--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm	2014-08-14 03:49:13 UTC (rev 172558)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm	2014-08-14 03:53:04 UTC (rev 172559)
@@ -405,7 +405,15 @@
 
     // Explicitly add a menu item for each telephone number that is in the selection.
     const Vector<String>& selectedTelephoneNumbers = context.selectedTelephoneNumbers();
-    if (!selectedTelephoneNumbers.isEmpty()) {
+    Vector<RetainPtr<NSMenuItem>> telephoneNumberMenuItems;
+    for (auto& telephoneNumber : selectedTelephoneNumbers) {
+        if (NSMenuItem *item = menuItemForTelephoneNumber(telephoneNumber)) {
+            [item setIndentationLevel:1];
+            telephoneNumberMenuItems.append(item);
+        }
+    }
+
+    if (!telephoneNumberMenuItems.isEmpty()) {
         if (m_servicesMenu)
             [m_servicesMenu insertItem:[NSMenuItem separatorItem] atIndex:0];
         else
@@ -414,12 +422,8 @@
         NSMenuItem *groupEntry = [[NSMenuItem alloc] initWithTitle:menuItemTitleForTelephoneNumberGroup() action:nil keyEquivalent:@""];
         [groupEntry setEnabled:NO];
         [m_servicesMenu insertItem:groupEntry atIndex:itemPosition++];
-        for (auto& telephoneNumber : selectedTelephoneNumbers) {
-            if (NSMenuItem *item = menuItemForTelephoneNumber(telephoneNumber)) {
-                [item setIndentationLevel:1];
-                [m_servicesMenu insertItem:item atIndex:itemPosition++];
-            }
-        }
+        for (auto& menuItem : telephoneNumberMenuItems)
+            [m_servicesMenu insertItem:menuItem.get() atIndex:itemPosition++];
     }
 
     // If there is no services menu, then the existing services on the system have changed, so refresh that list of services.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to