[iOS] Expose WebPageProxy::setInitialFocus as SPI
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Mar 2015 21:44:50 +0000 (21:44 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Mar 2015 21:44:50 +0000 (21:44 +0000)
commitded0365f443602e64a877ee331f67aec793fe118
tree520348478c24b64efee3ef58f1508d36e359c676
parent4da0aab1657ff469308cd0a1c2cabdbdd1d3bfc7
[iOS] Expose WebPageProxy::setInitialFocus as SPI
https://bugs.webkit.org/show_bug.cgi?id=142951

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): New SPI.
Just calls through to WKWebContentView, but allows a nil completion handler.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFirstResponder]): Pass an empty lambda for the new callback parameter to
WebPageProxy::setInitialFocus.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setInitialFocus): Added a void callback parameter and made sure to
call it.
* UIProcess/WebPageProxy.h:

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
Added. Calls WebPageProxy::setInitialFocus, and once that completes, checks if anything was
focused and if so, becomes first responder, then calls the completion handler.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setInitialFocus): Added a callbackID parameter, and made sure to send the
callback message. Added a temporary change of m_userIsInteracting to true, so that the UI
process won’t ignore any StartAssistingNode message resulting from the focus change.
* WebProcess/WebPage/WebPage.h:

* WebProcess/WebPage/WebPage.messages.in: Added a callbackID parameter to SetInitialFocus.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in