Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2547c620af570749a7942d4ea8ecbbdbd4b259d4
      
https://github.com/WebKit/WebKit/commit/2547c620af570749a7942d4ea8ecbbdbd4b259d4
  Author: Youenn Fablet <[email protected]>
  Date:   2024-10-09 (Wed, 09 Oct 2024)

  Changed paths:
    M Source/WebCore/page/MediaProducer.h
    M Source/WebKit/UIProcess/API/APIUIClient.h
    M Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.h
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/GetDisplayMediaWindowAndScreen.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/media-session-capture.html
    M Tools/TestWebKitAPI/cocoa/UserMediaCaptureUIDelegate.mm

  Log Message:
  -----------
  Allow setScreenshareActive to override WKWebView muting
rdar://137410714
https://bugs.webkit.org/show_bug.cgi?id=280960

Reviewed by Eric Carlson.

When WKWebView mutes screenshare, setScreenshareActive was not allowed to 
unmute.
We are introducing a new decidePolicyForScreenCaptureUnmute APIUIClient 
callback to allow WKWebView to decide what to do.
The default implementation is to deny unmuting.
UIDelegate exposes a 
[_webView:decidePolicyForScreenCaptureUnmuteForOrigin:initiatedByFrame:decisionHandler:]
 delegate.
If no delegate is implemented, a Allow/Deny prompt is used, via 
alertForPermission for MediaPermissionReason::ScreenCapture.

Drive-by fix in MediaProducer since this can confuse which state is actually 
muted.

Covered by added API test.

* Source/WebCore/page/MediaProducer.h:
* Source/WebKit/UIProcess/API/APIUIClient.h:
(API::UIClient::decidePolicyForScreenCaptureUnmute):
* Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForScreenCaptureUnmute):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::validateCaptureStateUpdate):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/GetDisplayMediaWindowAndScreen.mm:
(-[DisplayGUMMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::TEST(WebKit2, ToggleScreenshare)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/media-session-capture.html:
* Tools/TestWebKitAPI/cocoa/UserMediaCaptureUIDelegate.mm:
(-[UserMediaCaptureUIDelegate 
_webView:decidePolicyForScreenCaptureUnmuteForOrigin:initiatedByFrame:decisionHandler:]):

Canonical link: https://commits.webkit.org/284883@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to