Title: [186806] trunk/Source/WebKit2
- Revision
- 186806
- Author
- [email protected]
- Date
- 2015-07-14 10:26:11 -0700 (Tue, 14 Jul 2015)
Log Message
https://bugs.webkit.org/show_bug.cgi?id=146909
Add actions for default link preview that uses SFSafariViewController.
Use the new private properties to prepare actions for the default link preview controller.
Patch by Yongjun Zhang <[email protected]> on 2015-07-14
Reviewed by Dan Bernstein.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView previewViewControllerForPosition:inSourceView:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (186805 => 186806)
--- trunk/Source/WebKit2/ChangeLog 2015-07-14 17:24:29 UTC (rev 186805)
+++ trunk/Source/WebKit2/ChangeLog 2015-07-14 17:26:11 UTC (rev 186806)
@@ -1,3 +1,15 @@
+2015-07-14 Yongjun Zhang <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=146909
+ Add actions for default link preview that uses SFSafariViewController.
+
+ Use the new private properties to prepare actions for the default link preview controller.
+
+ Reviewed by Dan Bernstein.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView previewViewControllerForPosition:inSourceView:]):
+
2015-07-14 Michael Catanzaro <[email protected]>
[Linux] SeccompFilters: whitelist source directory on all ports
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (186805 => 186806)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-07-14 17:24:29 UTC (rev 186805)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-07-14 17:26:11 UTC (rev 186806)
@@ -3224,11 +3224,12 @@
if (canShowLinkPreview) {
_previewType = PreviewElementType::Link;
NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.url];
+ RetainPtr<_WKActivatedElementInfo> elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeLink URL:targetURL location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:_positionInformation.image.get()]);
+ RetainPtr<NSArray> actions = [_actionSheetAssistant defaultActionsForLinkSheet:elementInfo.get()];
if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForURL:defaultActions:elementInfo:)]) {
_highlightLongPressCanClick = NO;
- RetainPtr<_WKActivatedElementInfo> elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeLink URL:targetURL location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:_positionInformation.image.get()]);
_page->startInteractionWithElementAtPosition(_positionInformation.point);
- return [uiDelegate _webView:_webView previewViewControllerForURL:targetURL defaultActions:[_actionSheetAssistant defaultActionsForLinkSheet:elementInfo.get()].get() elementInfo:elementInfo.get()];
+ return [uiDelegate _webView:_webView previewViewControllerForURL:targetURL defaultActions:actions.get() elementInfo:elementInfo.get()];
}
if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForURL:)]) {
@@ -3238,7 +3239,10 @@
#if HAVE(SAFARI_SERVICES_FRAMEWORK)
SFSafariViewController *previewViewController = [allocSFSafariViewControllerInstance() initWithURL:targetURL];
previewViewController._showingLinkPreview = YES;
+ previewViewController._activatedElementInfo = elementInfo.get();
+ previewViewController._previewActions = actions.get();
_highlightLongPressCanClick = NO;
+ _page->startInteractionWithElementAtPosition(_positionInformation.point);
return [previewViewController autorelease];
#else
return nil;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes