[iOS] Add basic support for link navigation in WKPDFView
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Sep 2014 18:05:36 +0000 (18:05 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Sep 2014 18:05:36 +0000 (18:05 +0000)
commitdcd5364676affa09fb3a2abb604825313ecc829a
treedb87eb73c35d8dd34cdbc212b2069bda2e982366
parent4e773c19e0294086b5ad757c5f2bbbcd4c4135d8
[iOS] Add basic support for link navigation in WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=137182

Reviewed by Tim Horton.

Teach WKPDFView to navigate to URLs when PDF link annotations are tapped.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::navigateToURLWithSimulatedClick): Sent Messages::WebPage::NavigateToURLWithSimulatedClick.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKPDFView.h:
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _clearPages]): Removed self as the UIPDFAnnotationControllerDelegate.
(-[WKPDFView _revalidateViews]): Added self as the UIPDFAnnotationControllerDelegate.
(-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Retrieved the URL from the touched annotation,
computed the touched point relative to the WKPDFView and to the screen, and called
navigateToURLWithSimulatedClick() after a 200 ms delay in order to show a soon-to-be-added tap highlight
(this value matches the delay in UIWebPDFView).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToURLWithSimulatedClick): Created a fake single-click MouseEvent and called
FrameLoader::urlSelected(). Creating a mouse event ensures that the navigation appears as a
NavigationTypeLinkClicked in navigation policy delegates.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/WKPDFView.h
Source/WebKit2/UIProcess/ios/WKPDFView.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in