Don't show the combined menu if there are no services available
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Aug 2014 20:03:26 +0000 (20:03 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Aug 2014 20:03:26 +0000 (20:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135846
<rdar://problem/17582099>

Reviewed by Enrica Casucci.

* WebProcess/WebPage/ServicesOverlayController.h:
Add a FIXME.

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::determineActiveHighlight):
Don't allow a selection Highlight to become active if there is no
service available to handle it. Previously we showed the combined menu
with just phone numbers in it if any were detected.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/ServicesOverlayController.h
Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm

index 6ff0b28baa7742bbd698662070465dc029c2f98d..425a37e1f59ba84a391f65d7ee61f2406d545ad1 100644 (file)
@@ -1,3 +1,20 @@
+2014-08-12  Tim Horton  <timothy_horton@apple.com>
+
+        Don't show the combined menu if there are no services available
+        https://bugs.webkit.org/show_bug.cgi?id=135846
+        <rdar://problem/17582099>
+
+        Reviewed by Enrica Casucci.
+
+        * WebProcess/WebPage/ServicesOverlayController.h:
+        Add a FIXME.
+
+        * WebProcess/WebPage/mac/ServicesOverlayController.mm:
+        (WebKit::ServicesOverlayController::determineActiveHighlight):
+        Don't allow a selection Highlight to become active if there is no
+        service available to handle it. Previously we showed the combined menu
+        with just phone numbers in it if any were detected.
+
 2014-08-12  Tim Horton  <timothy_horton@apple.com>
 
         Add a fade transition to services highlights
index 00ec39942e0ce1821c4b0d3633b1dd6322a8e9cb..329d08f5935a1ec14a5578dc34bedbae17316f95 100644 (file)
@@ -143,6 +143,7 @@ private:
 
     HashSet<Highlight*> m_highlights;
 
+    // FIXME: These should move onto Highlight.
     Vector<WebCore::LayoutRect> m_currentSelectionRects;
     bool m_isTextOnly;
 
index 6004b8ad4f80947751dd4fe149a301762f4023bf..098b579ac518e23a4487f9a85a5891a921592e55 100644 (file)
@@ -589,8 +589,8 @@ void ServicesOverlayController::determineActiveHighlight(bool& mouseIsOverActive
             if (newActiveHighlight && newActiveHighlight->type() == Highlight::Type::TelephoneNumber)
                 continue;
 
-            // If this highlight has no compatible services, it can't be active, unless we have telephone number highlights to show in the combined menu.
-            if (telephoneNumberRangesForFocusedFrame().isEmpty() && !hasRelevantSelectionServices())
+            // If this highlight has no compatible services, it can't be active.
+            if (!hasRelevantSelectionServices())
                 continue;
         }