[WK2] Unify macOS and iOS codepaths in the UI process when starting a drag
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jan 2018 18:49:11 +0000 (18:49 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jan 2018 18:49:11 +0000 (18:49 +0000)
commit3955b006fc8f9af4d14131c896b570f223ca5b47
tree8c29f87bdd7b3e9a753601e908e74d1349eb0b49
parent8093b641bde94a3814bf802722c5aa5cb25a0fa5
[WK2] Unify macOS and iOS codepaths in the UI process when starting a drag
https://bugs.webkit.org/show_bug.cgi?id=181574

Reviewed by Tim Horton.

Rearrange some macOS drag start logic in the UI process so that it uses the same codepaths in WebPageProxy as
iOS. Namely, startDrag should just forward the DragItem and drag image handle along to the appropriate views on
each platform (WKContentView and WebViewImpl).

There should be no change in behavior.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:

Both macOS and iOS now funnel through this method.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::startDrag):
(WebKit::WebViewImpl::dragImageForView): Deleted.

Rename dragImageForView to startDrag. Move the call to didStartDrag() here, and call dragCancelled() in the
case where we bailed from starting the drag (due to failing to create a drag image).

* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setDragImage): Deleted.

Rename setDragImage to startDrag.

* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::startDrag):
(WebKit::PageClientImpl::setDragImage): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::startDrag): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/mac/PageClientImplMac.h
Source/WebKit/UIProcess/mac/PageClientImplMac.mm
Source/WebKit/UIProcess/mac/WebPageProxyMac.mm