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

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: address pkasting@'s comments 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
« no previous file with comments | « chrome/browser/media/webrtc/media_capture_devices_dispatcher.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b62fbc0de78230b03dce924dfa78045e9460ff2a 100644
--- a/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
+++ b/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
@@ -234,6 +234,19 @@ 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)
+ return prefs->GetString(prefs::kDefaultVideoCaptureDevice);
+ else
+ return std::string();
+}
+
const content::MediaStreamDevice*
MediaCaptureDevicesDispatcher::GetRequestedAudioDevice(
const std::string& requested_audio_device_id) {
« no previous file with comments | « chrome/browser/media/webrtc/media_capture_devices_dispatcher.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698