[iOS] SOAuthorizationSession should tell AppSSO whether the UIClient is capable of...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jul 2019 18:56:48 +0000 (18:56 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jul 2019 18:56:48 +0000 (18:56 +0000)
commit25011ea9381ae8fe6e8f514ac4e969609c9e2ed9
tree9b584ea2bfcac34b8d1ed3ab8fe080129d7ef9b6
parent9b1b026187afbdea4e965c2eb147495e6a287d59
[iOS] SOAuthorizationSession should tell AppSSO whether the UIClient is capable of showing the extension UI
https://bugs.webkit.org/show_bug.cgi?id=199790
<rdar://problem/52790112>

Reviewed by Brent Fulgham.

Source/WebKit:

On iOS, WebKit relies on a SPI -[WKUIDelegatePrivate _presentingViewControllerForWebView:] to present the
extension UI. However, third party clients often don't implement this SPI. Therefore, WebKit will not be
able to present the extension UI for them.

To be able to show the extension UI for third party WebKit clients, WebKit should unset SOAuthorization.enableEmbeddedAuthorizationViewController
whenever clients don't implement the above SPI such that AppSSO could show the UI in their UI process.

* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::start):

Tools:

Add tests to check SOAuthorization.enableEmbeddedAuthorizationViewController accordingly.

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(-[TestSOAuthorizationDelegate _presentingViewControllerForWebView:]):
(configureSOAuthorizationWebView):
(TestWebKitAPI::TEST):
(-[TestSOAuthorizationNavigationDelegate init]): Deleted.
(-[TestSOAuthorizationNavigationDelegate webView:didFinishNavigation:]): Deleted.
(-[TestSOAuthorizationNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
(-[TestSOAuthorizationNavigationDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]): Deleted.
(-[TestSOAuthorizationNavigationDelegate _webView:decidePolicyForSOAuthorizationLoadWithCurrentPolicy:forExtension:completionHandler:]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm