Changeset 233589 in webkit
- Timestamp:
- Jul 6, 2018, 1:13:22 PM (8 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKPDFView.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r233587 r233589 1 2018-07-06 Andy Estes <aestes@apple.com> 2 3 [iOS] WKPDFView should show the Data Detectors sheet when long-pressing a URL that Data Detectors can handle 4 https://bugs.webkit.org/show_bug.cgi?id=187396 5 <rdar://problem/41786980> 6 7 Reviewed by Dan Bernstein. 8 9 If a URL can be presented by Data Detectors, show the Data Detectors sheet instead 10 of the link sheet. Also implement the optional WKActionSheetAssistantDelegate 11 method that asks the UI delegate for its data detection context. 12 13 * UIProcess/ios/WKPDFView.mm: 14 (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]): 15 (-[WKPDFView dataDetectionContextForActionSheetAssistant:]): 16 1 17 2018-07-06 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebKit/UIProcess/ios/WKPDFView.mm
r233501 r233589 33 33 #import "PDFKitSPI.h" 34 34 #import "WKActionSheetAssistant.h" 35 #import "WKUIDelegatePrivate.h" 35 36 #import "WKWebViewInternal.h" 36 37 #import "WebPageProxy.h" 37 38 #import "_WKWebViewPrintFormatterInternal.h" 38 39 #import <MobileCoreServices/MobileCoreServices.h> 40 #import <WebCore/DataDetection.h> 39 41 #import <WebCore/WebCoreNSURLExtras.h> 40 42 #import <wtf/BlockPtr.h> … … 440 442 441 443 _positionInformation = WTFMove(positionInformation); 442 [_actionSheetAssistant showLinkSheet]; 444 #if ENABLE(DATA_DETECTION) 445 if (WebCore::DataDetection::canBePresentedByDataDetectors(_positionInformation.url)) 446 [_actionSheetAssistant showDataDetectorsSheet]; 447 else 448 #endif 449 [_actionSheetAssistant showLinkSheet]; 443 450 } 444 451 … … 514 521 } 515 522 523 - (NSDictionary *)dataDetectionContextForActionSheetAssistant:(WKActionSheetAssistant *)assistant 524 { 525 auto webView = _webView.getAutoreleased(); 526 if (!webView) 527 return nil; 528 529 id <WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>(webView.UIDelegate); 530 if (![uiDelegate respondsToSelector:@selector(_dataDetectionContextForWebView:)]) 531 return nil; 532 533 return [uiDelegate _dataDetectionContextForWebView:webView]; 534 } 535 516 536 @end 517 537
Note:
See TracChangeset
for help on using the changeset viewer.