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 #ifndef CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // are available. | 125 // are available. |
126 const content::MediaStreamDevice* GetFirstAvailableAudioDevice(); | 126 const content::MediaStreamDevice* GetFirstAvailableAudioDevice(); |
127 const content::MediaStreamDevice* GetFirstAvailableVideoDevice(); | 127 const content::MediaStreamDevice* GetFirstAvailableVideoDevice(); |
128 | 128 |
129 // Unittests that do not require actual device enumeration should call this | 129 // Unittests that do not require actual device enumeration should call this |
130 // API on the singleton. It is safe to call this multiple times on the | 130 // API on the singleton. It is safe to call this multiple times on the |
131 // signleton. | 131 // signleton. |
132 void DisableDeviceEnumerationForTesting(); | 132 void DisableDeviceEnumerationForTesting(); |
133 | 133 |
134 // Overridden from content::MediaObserver: | 134 // Overridden from content::MediaObserver: |
135 virtual void OnAudioCaptureDevicesChanged() OVERRIDE; | 135 virtual void OnAudioCaptureDevicesChanged() override; |
136 virtual void OnVideoCaptureDevicesChanged() OVERRIDE; | 136 virtual void OnVideoCaptureDevicesChanged() override; |
137 virtual void OnMediaRequestStateChanged( | 137 virtual void OnMediaRequestStateChanged( |
138 int render_process_id, | 138 int render_process_id, |
139 int render_frame_id, | 139 int render_frame_id, |
140 int page_request_id, | 140 int page_request_id, |
141 const GURL& security_origin, | 141 const GURL& security_origin, |
142 content::MediaStreamType stream_type, | 142 content::MediaStreamType stream_type, |
143 content::MediaRequestState state) OVERRIDE; | 143 content::MediaRequestState state) override; |
144 virtual void OnCreatingAudioStream(int render_process_id, | 144 virtual void OnCreatingAudioStream(int render_process_id, |
145 int render_frame_id) OVERRIDE; | 145 int render_frame_id) override; |
146 | 146 |
147 scoped_refptr<MediaStreamCaptureIndicator> GetMediaStreamCaptureIndicator(); | 147 scoped_refptr<MediaStreamCaptureIndicator> GetMediaStreamCaptureIndicator(); |
148 | 148 |
149 DesktopStreamsRegistry* GetDesktopStreamsRegistry(); | 149 DesktopStreamsRegistry* GetDesktopStreamsRegistry(); |
150 | 150 |
151 bool IsDesktopCaptureInProgress(); | 151 bool IsDesktopCaptureInProgress(); |
152 | 152 |
153 // Only for testing. | 153 // Only for testing. |
154 void SetTestAudioCaptureDevices(const content::MediaStreamDevices& devices); | 154 void SetTestAudioCaptureDevices(const content::MediaStreamDevices& devices); |
155 void SetTestVideoCaptureDevices(const content::MediaStreamDevices& devices); | 155 void SetTestVideoCaptureDevices(const content::MediaStreamDevices& devices); |
(...skipping 13 matching lines...) Expand all Loading... |
169 }; | 169 }; |
170 typedef std::deque<PendingAccessRequest> RequestsQueue; | 170 typedef std::deque<PendingAccessRequest> RequestsQueue; |
171 typedef std::map<content::WebContents*, RequestsQueue> RequestsQueues; | 171 typedef std::map<content::WebContents*, RequestsQueue> RequestsQueues; |
172 | 172 |
173 MediaCaptureDevicesDispatcher(); | 173 MediaCaptureDevicesDispatcher(); |
174 virtual ~MediaCaptureDevicesDispatcher(); | 174 virtual ~MediaCaptureDevicesDispatcher(); |
175 | 175 |
176 // content::NotificationObserver implementation. | 176 // content::NotificationObserver implementation. |
177 virtual void Observe(int type, | 177 virtual void Observe(int type, |
178 const content::NotificationSource& source, | 178 const content::NotificationSource& source, |
179 const content::NotificationDetails& details) OVERRIDE; | 179 const content::NotificationDetails& details) override; |
180 | 180 |
181 // Helpers for ProcessMediaAccessRequest(). | 181 // Helpers for ProcessMediaAccessRequest(). |
182 void ProcessDesktopCaptureAccessRequest( | 182 void ProcessDesktopCaptureAccessRequest( |
183 content::WebContents* web_contents, | 183 content::WebContents* web_contents, |
184 const content::MediaStreamRequest& request, | 184 const content::MediaStreamRequest& request, |
185 const content::MediaResponseCallback& callback, | 185 const content::MediaResponseCallback& callback, |
186 const extensions::Extension* extension); | 186 const extensions::Extension* extension); |
187 void ProcessScreenCaptureAccessRequest( | 187 void ProcessScreenCaptureAccessRequest( |
188 content::WebContents* web_contents, | 188 content::WebContents* web_contents, |
189 const content::MediaStreamRequest& request, | 189 const content::MediaStreamRequest& request, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 int render_frame_id; | 250 int render_frame_id; |
251 int page_request_id; | 251 int page_request_id; |
252 }; | 252 }; |
253 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; | 253 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; |
254 DesktopCaptureSessions desktop_capture_sessions_; | 254 DesktopCaptureSessions desktop_capture_sessions_; |
255 | 255 |
256 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); | 256 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); |
257 }; | 257 }; |
258 | 258 |
259 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 259 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
OLD | NEW |