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

Side by Side Diff: content/browser/renderer_host/media/media_stream_ui_proxy.cc

Issue 88283002: Reland review 34393006: Refactor MediaStreamManager to not output real device id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" 5 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h"
6 6
7 #include "content/browser/renderer_host/render_view_host_delegate.h" 7 #include "content/browser/renderer_host/render_view_host_delegate.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "media/video/capture/fake_video_capture_device.h" 10 #include "media/video/capture/fake_video_capture_device.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 MediaStreamDevices devices_to_use; 187 MediaStreamDevices devices_to_use;
188 bool accepted_audio = false; 188 bool accepted_audio = false;
189 bool accepted_video = false; 189 bool accepted_video = false;
190 // Use the first capture device of the same media type in the list for the 190 // Use the first capture device of the same media type in the list for the
191 // fake UI. 191 // fake UI.
192 for (MediaStreamDevices::const_iterator it = devices_.begin(); 192 for (MediaStreamDevices::const_iterator it = devices_.begin();
193 it != devices_.end(); ++it) { 193 it != devices_.end(); ++it) {
194 if (!accepted_audio && 194 if (!accepted_audio &&
195 IsAudioMediaType(request.audio_type) && 195 IsAudioMediaType(request.audio_type) &&
196 IsAudioMediaType(it->type)) { 196 IsAudioMediaType(it->type) &&
197 (request.requested_audio_device_id.empty() ||
198 request.requested_audio_device_id == it->id)) {
197 devices_to_use.push_back(*it); 199 devices_to_use.push_back(*it);
198 accepted_audio = true; 200 accepted_audio = true;
199 } else if (!accepted_video && 201 } else if (!accepted_video &&
200 IsVideoMediaType(request.video_type) && 202 IsVideoMediaType(request.video_type) &&
201 IsVideoMediaType(it->type)) { 203 IsVideoMediaType(it->type) &&
204 (request.requested_video_device_id.empty() ||
205 request.requested_video_device_id == it->id)) {
202 devices_to_use.push_back(*it); 206 devices_to_use.push_back(*it);
203 accepted_video = true; 207 accepted_video = true;
204 } 208 }
205 } 209 }
206 210
207 BrowserThread::PostTask( 211 BrowserThread::PostTask(
208 BrowserThread::IO, FROM_HERE, 212 BrowserThread::IO, FROM_HERE,
209 base::Bind(&MediaStreamUIProxy::ProcessAccessRequestResponse, 213 base::Bind(&MediaStreamUIProxy::ProcessAccessRequestResponse,
210 weak_factory_.GetWeakPtr(), devices_to_use)); 214 weak_factory_.GetWeakPtr(), devices_to_use));
211 } 215 }
212 216
213 void FakeMediaStreamUIProxy::OnStarted(const base::Closure& stop_callback) { 217 void FakeMediaStreamUIProxy::OnStarted(const base::Closure& stop_callback) {
214 } 218 }
215 219
216 } // namespace content 220 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698