fix: systemMediaPermissionDenied should not check camera perms when the request is asking for screen share (#43517)

* fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera

* Revert "fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera"

This reverts commit e9cc672165.

* should only do these checks for audio or video, but not screenshare

* no service

* oops

---------

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
George Xu 2024-09-04 04:56:26 -04:00 коммит произвёл GitHub
Родитель b42c0ae00d
Коммит 635d421123
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -57,7 +57,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 ==
@ -65,7 +65,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 ==
@ -73,6 +73,7 @@ bool SystemMediaPermissionDenied(const content::MediaStreamRequest& request) {
system_video_permission ==
system_media_permissions::SystemPermission::kDenied;
}
return false;
}
#endif