Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: chrome/browser/media/media_capture_devices_dispatcher.cc

Issue 599903002: Force extension media access to obey enterprise policy. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/media_capture_devices_dispatcher.cc
diff --git a/chrome/browser/media/media_capture_devices_dispatcher.cc b/chrome/browser/media/media_capture_devices_dispatcher.cc
index def0efa240eadcec162d11fc3b25e436fe2ac12d..7a90dabb1e0230d6b502dd743eb7860071c2f108 100644
--- a/chrome/browser/media/media_capture_devices_dispatcher.cc
+++ b/chrome/browser/media/media_capture_devices_dispatcher.cc
@@ -697,14 +697,23 @@ void MediaCaptureDevicesDispatcher::
// MediaStreamDevicesController::Accept(). Move this code into a shared method
// between the two classes.
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
+
bool audio_allowed =
request.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE &&
extension->permissions_data()->HasAPIPermission(
- extensions::APIPermission::kAudioCapture);
+ extensions::APIPermission::kAudioCapture) &&
+ GetDevicePolicy(profile, extension->url(),
+ prefs::kAudioCaptureAllowed,
+ prefs::kAudioCaptureAllowedUrls) != ALWAYS_DENY;
bool video_allowed =
request.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE &&
extension->permissions_data()->HasAPIPermission(
- extensions::APIPermission::kVideoCapture);
+ extensions::APIPermission::kVideoCapture) &&
+ GetDevicePolicy(profile, extension->url(),
+ prefs::kVideoCaptureAllowed,
+ prefs::kVideoCaptureAllowedUrls) != ALWAYS_DENY;
bool get_default_audio_device = audio_allowed;
bool get_default_video_device = video_allowed;
@@ -732,8 +741,6 @@ void MediaCaptureDevicesDispatcher::
// If either or both audio and video devices were requested but not
// specified by id, get the default devices.
if (get_default_audio_device || get_default_video_device) {
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
GetDefaultDevicesForProfile(profile,
get_default_audio_device,
get_default_video_device,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698