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

Unified Diff: content/browser/renderer_host/media/media_stream_dispatcher_host.cc

Issue 323313003: Add flag in device enumeration request to control label clearing and don't clear for pepper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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
Index: content/browser/renderer_host/media/media_stream_dispatcher_host.cc
diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
index 6b382cd589106539f866d351e3ad716727325467..91fad34fe5c24c96e46c293196af9bd1fd404345 100644
--- a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
@@ -170,7 +170,8 @@ void MediaStreamDispatcherHost::OnEnumerateDevices(
int render_view_id,
int page_request_id,
MediaStreamType type,
- const GURL& security_origin) {
+ const GURL& security_origin,
+ bool hide_labels_if_no_access) {
DVLOG(1) << "MediaStreamDispatcherHost::OnEnumerateDevices("
<< render_view_id << ", "
<< page_request_id << ", "
@@ -183,10 +184,14 @@ void MediaStreamDispatcherHost::OnEnumerateDevices(
DCHECK(type == MEDIA_DEVICE_AUDIO_CAPTURE ||
type == MEDIA_DEVICE_VIDEO_CAPTURE ||
type == MEDIA_DEVICE_AUDIO_OUTPUT);
- bool have_permission =
- type == MEDIA_DEVICE_AUDIO_CAPTURE || type == MEDIA_DEVICE_AUDIO_OUTPUT ?
- resource_context_->AllowMicAccess(security_origin) :
- resource_context_->AllowCameraAccess(security_origin);
+ bool have_permission = true;
+ if (hide_labels_if_no_access) {
+ bool audio_type = type == MEDIA_DEVICE_AUDIO_CAPTURE ||
+ type == MEDIA_DEVICE_AUDIO_OUTPUT;
+ have_permission = audio_type ?
+ resource_context_->AllowMicAccess(security_origin) :
+ resource_context_->AllowCameraAccess(security_origin);
+ }
media_stream_manager_->EnumerateDevices(
this, render_process_id_, render_view_id, salt_callback_,

Powered by Google App Engine
This is Rietveld 408576698