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

This commit is contained in:
George Xu 2024-08-30 14:00:34 -04:00
Родитель c41a28d7c8
Коммит e9cc672165
Не найден ключ, соответствующий данной подписи
1 изменённых файлов: 16 добавлений и 6 удалений

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

@ -66,12 +66,22 @@ bool SystemMediaPermissionDenied(const content::MediaStreamRequest& request) {
system_media_permissions::SystemPermission::kDenied; system_media_permissions::SystemPermission::kDenied;
} }
if (request.video_type != MediaStreamType::NO_SERVICE) { if (request.video_type != MediaStreamType::NO_SERVICE) {
const auto system_video_permission = if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE ||
system_media_permissions::CheckSystemVideoCapturePermission(); request.video_type == MediaStreamType::GUM_TAB_VIDEO_CAPTURE) {
return system_video_permission == const auto system_screen_permission =
system_media_permissions::SystemPermission::kRestricted || system_media_permissions::CheckSystemScreenCapturePermission();
system_video_permission == return system_screen_permission ==
system_media_permissions::SystemPermission::kDenied; system_media_permissions::SystemPermission::kRestricted ||
system_screen_permission ==
system_media_permissions::SystemPermission::kDenied;
} else {
const auto system_video_permission =
system_media_permissions::CheckSystemVideoCapturePermission();
return system_video_permission ==
system_media_permissions::SystemPermission::kRestricted ||
system_video_permission ==
system_media_permissions::SystemPermission::kDenied;
}
} }
return false; return false;
} }