Share more code between iOS and macOS ViewGestureController
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2016 07:13:32 +0000 (07:13 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2016 07:13:32 +0000 (07:13 +0000)
commite8449fb7e1e366b8392712867fba5d017848e4e4
tree2c81251f0e9a619ef59a8f7f6f233714ea7ba6c3
parentbf0f4624aa062f9666101fb8dd84124d1b2d2c97
Share more code between iOS and macOS ViewGestureController
https://bugs.webkit.org/show_bug.cgi?id=163158

Reviewed by Simon Fraser.

Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
because it shouldn't know anything about WKWebView.
Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsBackForwardNavigationGestures:]):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection):
(WebKit::ViewGestureController::gestureControllerForPage): Deleted.
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::createWeakPtr):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
(WebKit::ViewGestureController::canSwipeInDirection): Deleted.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/Cocoa/ViewGestureController.cpp
Source/WebKit2/UIProcess/Cocoa/ViewGestureController.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm
Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm