It should be possible to open a page preview by clicking on it
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Nov 2014 23:53:44 +0000 (23:53 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Nov 2014 23:53:44 +0000 (23:53 +0000)
commit1f3a1e030acd7f00e6b2190e751ccd85f23aeee9
tree19fc413f12057aad63fb0cc3f1132a1a24b38713
parent5f81b2f2b7a069f9879fb8cc41871c0b769d2ff0
It should be possible to open a page preview by clicking on it
https://bugs.webkit.org/show_bug.cgi?id=138445

Reviewed by Tim Horton.
Patch by Conrad Shultz.

Add a click recognizer to WKPagePreviewViewController and plumb it through to WKActionMenuController.

* UIProcess/mac/WKActionMenuController.mm:
Declare <WKPagePreviewViewControllerDelegate>, currently home to just a single method.
(-[WKPagePreviewViewController loadView]):
Configure and add a click gesture recognizer to the WKWebView.
(-[WKPagePreviewViewController _clickRecognized:]):
Gesture recognizer action; send -pagePreviewViewControllerWasClicked: to the delegate.
(-[WKActionMenuController willDestroyView:]):
Extract code to -_clearPreviewPopover.
(-[WKActionMenuController didCloseMenu:withEvent:]):
Ditto.
(-[WKActionMenuController _createPreviewPopoverForURL:]):
Set ourself as the delegate of the page preview controller.
(-[WKActionMenuController _clearPreviewPopover]):
Extracted from various other methods; if appropriate, nil out the preview view controller's delegate.
(-[WKActionMenuController popoverWillClose:]):
Extract code to -_clearPreviewPopover.
(-[WKActionMenuController pagePreviewViewControllerWasClicked:]):
WKPagePreviewViewControllerDelegate method; open the URL of the clicked page.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm