Title: [176247] branches/safari-600.3-branch/Source/WebKit2
Revision
176247
Author
[email protected]
Date
2014-11-17 19:29:02 -0800 (Mon, 17 Nov 2014)

Log Message

Merge r176150. rdar://problem/18982046

Modified Paths

Diff

Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (176246 => 176247)


--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-11-18 03:23:07 UTC (rev 176246)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-11-18 03:29:02 UTC (rev 176247)
@@ -1,5 +1,24 @@
 2014-11-17  Dana Burkart  <[email protected]>
 
+        Merge r176150. <rdar://problem/18982046>
+
+    2014-11-14  Tim Horton  <[email protected]>
+    
+            Remove pre-[DDActionContext contextForView:...] fallback path
+            https://bugs.webkit.org/show_bug.cgi?id=138735
+            <rdar://problem/18982046>
+    
+            Reviewed by Simon Fraser.
+    
+            * UIProcess/mac/WKActionMenuController.mm:
+            (-[WKActionMenuController willOpenMenu:withEvent:]):
+            (-[WKActionMenuController didCloseMenu:withEvent:]):
+            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
+            (hasDataDetectorsCompletionAPI): Deleted.
+            Remove the now-unnecessary fallback path.
+    
+2014-11-17  Dana Burkart  <[email protected]>
+
         Merge r176148. <rdar://problem/18990684>
 
     2014-11-14  Tim Horton  <[email protected]>

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (176246 => 176247)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm	2014-11-18 03:23:07 UTC (rev 176246)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm	2014-11-18 03:29:02 UTC (rev 176247)
@@ -54,15 +54,6 @@
 SOFT_LINK_FRAMEWORK_IN_UMBRELLA(Quartz, ImageKit)
 SOFT_LINK_CLASS(ImageKit, IKSlideshow)
 
-static bool hasDataDetectorsCompletionAPI() {
-    static bool hasCompletionAPI;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        hasCompletionAPI = [getDDActionsManagerClass() respondsToSelector:@selector(shouldUseActionsWithContext:)] && [getDDActionsManagerClass() respondsToSelector:@selector(didUseActions)];
-    });
-    return hasCompletionAPI;
-}
-
 using namespace WebCore;
 using namespace WebKit;
 
@@ -201,17 +192,13 @@
         return;
 
     if (_type == kWKActionMenuDataDetectedItem) {
-        if (_currentActionContext && hasDataDetectorsCompletionAPI()) {
-            if (![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
-                [menu cancelTracking];
-                return;
-            }
+        if (_currentActionContext && ![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
+            [menu cancelTracking];
+            return;
         }
-        if (menu.numberOfItems == 1) {
+        if (menu.numberOfItems == 1)
             _page->clearSelection();
-            if (!hasDataDetectorsCompletionAPI())
-                [self _showTextIndicator];
-        } else
+        else
             _page->selectLastActionMenuRange();
         return;
     }
@@ -234,13 +221,8 @@
         return;
 
     if (_type == kWKActionMenuDataDetectedItem) {
-        if (hasDataDetectorsCompletionAPI()) {
-            if (_currentActionContext)
-                [getDDActionsManagerClass() didUseActions];
-        } else {
-            if (menu.numberOfItems > 1)
-                [self _hideTextIndicator];
-        }
+        if (_currentActionContext)
+            [getDDActionsManagerClass() didUseActions];
     }
 
     if (!_shouldKeepPreviewPopoverOpen)
@@ -588,28 +570,18 @@
     if (!actionContext)
         return @[ ];
 
-    if (hasDataDetectorsCompletionAPI()) {
-        // Ref our WebPageProxy for use in the blocks below.
-        RefPtr<WebPageProxy> page = _page;
-        _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
-            page->send(Messages::WebPage::DataDetectorsDidPresentUI());
-        } interactionChangedHandler:^() {
-            [self _showTextIndicator];
-            page->send(Messages::WebPage::DataDetectorsDidChangeUI());
-        } interactionStoppedHandler:^() {
-            [self _hideTextIndicator];
-            page->send(Messages::WebPage::DataDetectorsDidHideUI());
-        }];
-    } else {
-        _currentActionContext = actionContext;
+    // Ref our WebPageProxy for use in the blocks below.
+    RefPtr<WebPageProxy> page = _page;
+    _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
+        page->send(Messages::WebPage::DataDetectorsDidPresentUI());
+    } interactionChangedHandler:^() {
+        [self _showTextIndicator];
+        page->send(Messages::WebPage::DataDetectorsDidChangeUI());
+    } interactionStoppedHandler:^() {
+        [self _hideTextIndicator];
+        page->send(Messages::WebPage::DataDetectorsDidHideUI());
+    }];
 
-        [_currentActionContext setCompletionHandler:^() {
-            [self _hideTextIndicator];
-        }];
-
-        [_currentActionContext setForActionMenuContent:YES];
-    }
-
     [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResult.detectedDataBoundingBox toView:nil]]];
 
     return [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to