Skip to content

Commit

Permalink
Turn off desktop media capture from Document Picture in Picture
Browse files Browse the repository at this point in the history
Since the UI around media capture doesn't work with the always-on-
top picture in picture window, and since it's likely that it's not
something we want to support anyway, turn it off for origin trial.

Bug: 1410382
Change-Id: If86abad9ace8a38008f91eb48dca0abd54637aef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4195679
Reviewed-by: John Rummell <[email protected]>
Commit-Queue: Frank Liberato <[email protected]>
Reviewed-by: Elad Alon <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1097633}
  • Loading branch information
liberato-at-chromium authored and Chromium LUCI CQ committed Jan 26, 2023
1 parent aecd175 commit f69e1d2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chrome/browser/media/webrtc/capture_policy_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ bool IsOriginInList(const GURL& request_origin,
AllowedScreenCaptureLevel GetAllowedCaptureLevel(
const GURL& request_origin,
content::WebContents* capturer_web_contents) {
// Since the UI for capture doesn't clip against picture in picture windows
// properly on all platforms, and since it's not clear that we actually want
// to support this anyway, turn it off for now. Note that direct calls into
// `GetAllowedCaptureLevel(..., PrefService)` will miss this check.
// TODO(crbug.com/1410382): Consider turning this back on.
if (PictureInPictureWindowManager::IsChildWebContents(
capturer_web_contents)) {
return AllowedScreenCaptureLevel::kDisallowed;
}

// If we can't get the PrefService, then we won't apply any restrictions.
Profile* profile =
Profile::FromBrowserContext(capturer_web_contents->GetBrowserContext());
Expand Down

0 comments on commit f69e1d2

Please sign in to comment.