OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/media/media_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher() | 87 MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher() |
88 : devices_enumerated_(false), | 88 : devices_enumerated_(false), |
89 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()), | 89 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()), |
90 audio_stream_indicator_(new AudioStreamIndicator()) {} | 90 audio_stream_indicator_(new AudioStreamIndicator()) {} |
91 | 91 |
92 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} | 92 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} |
93 | 93 |
94 void MediaCaptureDevicesDispatcher::RegisterUserPrefs( | 94 void MediaCaptureDevicesDispatcher::RegisterUserPrefs( |
95 PrefRegistrySyncable* registry) { | 95 user_prefs::PrefRegistrySyncable* registry) { |
96 registry->RegisterStringPref(prefs::kDefaultAudioCaptureDevice, | 96 registry->RegisterStringPref( |
97 std::string(), | 97 prefs::kDefaultAudioCaptureDevice, |
98 PrefRegistrySyncable::UNSYNCABLE_PREF); | 98 std::string(), |
99 registry->RegisterStringPref(prefs::kDefaultVideoCaptureDevice, | 99 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
100 std::string(), | 100 registry->RegisterStringPref( |
101 PrefRegistrySyncable::UNSYNCABLE_PREF); | 101 prefs::kDefaultVideoCaptureDevice, |
| 102 std::string(), |
| 103 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
102 } | 104 } |
103 | 105 |
104 void MediaCaptureDevicesDispatcher::AddObserver(Observer* observer) { | 106 void MediaCaptureDevicesDispatcher::AddObserver(Observer* observer) { |
105 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
106 if (!observers_.HasObserver(observer)) | 108 if (!observers_.HasObserver(observer)) |
107 observers_.AddObserver(observer); | 109 observers_.AddObserver(observer); |
108 } | 110 } |
109 | 111 |
110 void MediaCaptureDevicesDispatcher::RemoveObserver(Observer* observer) { | 112 void MediaCaptureDevicesDispatcher::RemoveObserver(Observer* observer) { |
111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 int render_process_id, | 378 int render_process_id, |
377 int render_view_id, | 379 int render_view_id, |
378 const content::MediaStreamDevice& device, | 380 const content::MediaStreamDevice& device, |
379 content::MediaRequestState state) { | 381 content::MediaRequestState state) { |
380 FOR_EACH_OBSERVER(Observer, observers_, | 382 FOR_EACH_OBSERVER(Observer, observers_, |
381 OnRequestUpdate(render_process_id, | 383 OnRequestUpdate(render_process_id, |
382 render_view_id, | 384 render_view_id, |
383 device, | 385 device, |
384 state)); | 386 state)); |
385 } | 387 } |
OLD | NEW |