OLD | NEW |
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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/browser/frame_host/render_frame_host_delegate.h" | 8 #include "content/browser/frame_host/render_frame_host_delegate.h" |
9 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void MediaStreamUIProxy::Core::RequestAccess( | 60 void MediaStreamUIProxy::Core::RequestAccess( |
61 const MediaStreamRequest& request) { | 61 const MediaStreamRequest& request) { |
62 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 62 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
63 | 63 |
64 RenderFrameHostDelegate* render_delegate = GetRenderFrameHostDelegate( | 64 RenderFrameHostDelegate* render_delegate = GetRenderFrameHostDelegate( |
65 request.render_process_id, request.render_frame_id); | 65 request.render_process_id, request.render_frame_id); |
66 | 66 |
67 // Tab may have gone away, or has no delegate from which to request access. | 67 // Tab may have gone away, or has no delegate from which to request access. |
68 if (!render_delegate) { | 68 if (!render_delegate) { |
69 ProcessAccessRequestResponse( | 69 ProcessAccessRequestResponse(MediaStreamDevices(), |
70 MediaStreamDevices(), | 70 MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN, |
71 MEDIA_DEVICE_INVALID_STATE, | 71 scoped_ptr<MediaStreamUI>()); |
72 scoped_ptr<MediaStreamUI>()); | |
73 return; | 72 return; |
74 } | 73 } |
75 | 74 |
76 render_delegate->RequestMediaAccessPermission( | 75 render_delegate->RequestMediaAccessPermission( |
77 request, base::Bind(&Core::ProcessAccessRequestResponse, | 76 request, base::Bind(&Core::ProcessAccessRequestResponse, |
78 weak_factory_.GetWeakPtr())); | 77 weak_factory_.GetWeakPtr())); |
79 } | 78 } |
80 | 79 |
81 bool MediaStreamUIProxy::Core::CheckAccess(const GURL& security_origin, | 80 bool MediaStreamUIProxy::Core::CheckAccess(const GURL& security_origin, |
82 MediaStreamType type, | 81 MediaStreamType type, |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 callback, | 346 callback, |
348 have_access)); | 347 have_access)); |
349 return; | 348 return; |
350 } | 349 } |
351 | 350 |
352 void FakeMediaStreamUIProxy::OnStarted( | 351 void FakeMediaStreamUIProxy::OnStarted( |
353 const base::Closure& stop_callback, | 352 const base::Closure& stop_callback, |
354 const WindowIdCallback& window_id_callback) {} | 353 const WindowIdCallback& window_id_callback) {} |
355 | 354 |
356 } // namespace content | 355 } // namespace content |
OLD | NEW |