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

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

Issue 2629383002: Add functionality to get default media device IDs from user preferences. (Closed)
Patch Set: Created 3 years, 11 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: chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
diff --git a/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc b/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
index cf79263665dea1aae09a4f38e57a0804611c5675..57d8883cebf26403fe03ede934d365f5471a3cfe 100644
--- a/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
+++ b/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
@@ -234,6 +234,18 @@ void MediaCaptureDevicesDispatcher::GetDefaultDevicesForProfile(
}
}
+std::string MediaCaptureDevicesDispatcher::GetDefaultDeviceIdForProfile(
+ Profile* profile,
+ content::MediaStreamType type) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ PrefService* prefs = profile->GetPrefs();
+ if (type == content::MEDIA_DEVICE_AUDIO_CAPTURE)
+ return prefs->GetString(prefs::kDefaultAudioCaptureDevice);
+ else if (type == content::MEDIA_DEVICE_VIDEO_CAPTURE)
Peter Kasting 2017/01/17 21:02:46 Drive-by nit: No else after return
Guido Urdaneta 2017/01/18 15:03:59 Done.
+ return prefs->GetString(prefs::kDefaultVideoCaptureDevice);
+ return std::string();
+}
+
const content::MediaStreamDevice*
MediaCaptureDevicesDispatcher::GetRequestedAudioDevice(
const std::string& requested_audio_device_id) {

Powered by Google App Engine
This is Rietveld 408576698