Device Orientation access permission should be denied unless explicitly granted by...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2019 20:32:37 +0000 (20:32 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2019 20:32:37 +0000 (20:32 +0000)
commita0b2ccf42fa8c6cc3640f93abf29160fa69a1297
tree7c901281fd31e81a1c5f168a3da6d499df6c7d8c
parentec36d2eb09c4400a673ba9fa6115b7301a696892
Device Orientation access permission should be denied unless explicitly granted by the client
https://bugs.webkit.org/show_bug.cgi?id=195625

Reviewed by Youenn Fablet.

Source/WebKit:

Device Orientation access permission should be denied unless explicitly granted by the client.
Previously, it was granted by default.

* UIProcess/API/APIUIClient.h:
(API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):

Tools:

add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/DeviceOrientation.mm: Added.
(-[DeviceOrientationMessageHandler userContentController:didReceiveScriptMessage:]):
(-[DeviceOrientationPermissionUIDelegate initWithHandler:]):
(-[DeviceOrientationPermissionUIDelegate _webView:shouldAllowDeviceOrientationAndMotionAccessRequestedByFrame:decisionHandler:]):
(runDeviceOrientationTest):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[WebsitePoliciesDeviceOrientationUIDelegate _webView:shouldAllowDeviceOrientationAndMotionAccessRequestedByFrame:decisionHandler:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APIUIClient.h
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKitCocoa/DeviceOrientation.mm [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm