From 22c839437647bc33406546aab2f4fcbc6476f123 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:04:39 +0100 Subject: [PATCH] fix: systemMediaPermissionDenied should not check camera perms when the request is asking for screen share (#43544) * fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera Co-authored-by: George Xu * Revert "fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera" This reverts commit e9cc67216558263402867056ed332f8781da3153. Co-authored-by: George Xu * should only do these checks for audio or video, but not screenshare Co-authored-by: George Xu * no service Co-authored-by: George Xu * oops Co-authored-by: George Xu * build: free up macos disk space as soon as possible (#43533) * chore: free up macos disk space as soon as possible * build: free up disk space on gn check too Co-authored-by: John Kleinschmidt --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: George Xu Co-authored-by: John Kleinschmidt --- shell/browser/web_contents_permission_helper.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/browser/web_contents_permission_helper.cc b/shell/browser/web_contents_permission_helper.cc index f97385aaa121..59854d611d63 100644 --- a/shell/browser/web_contents_permission_helper.cc +++ b/shell/browser/web_contents_permission_helper.cc @@ -56,7 +56,7 @@ namespace { #if BUILDFLAG(IS_MAC) bool SystemMediaPermissionDenied(const content::MediaStreamRequest& request) { - if (request.audio_type != MediaStreamType::NO_SERVICE) { + if (request.audio_type == MediaStreamType::DEVICE_AUDIO_CAPTURE) { const auto system_audio_permission = system_media_permissions::CheckSystemAudioCapturePermission(); return system_audio_permission == @@ -64,7 +64,7 @@ bool SystemMediaPermissionDenied(const content::MediaStreamRequest& request) { system_audio_permission == system_media_permissions::SystemPermission::kDenied; } - if (request.video_type != MediaStreamType::NO_SERVICE) { + if (request.video_type == MediaStreamType::DEVICE_VIDEO_CAPTURE) { const auto system_video_permission = system_media_permissions::CheckSystemVideoCapturePermission(); return system_video_permission == @@ -72,6 +72,7 @@ bool SystemMediaPermissionDenied(const content::MediaStreamRequest& request) { system_video_permission == system_media_permissions::SystemPermission::kDenied; } + return false; } #endif