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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2421 #endif // defined(VIDEO_HOLE) | 2421 #endif // defined(VIDEO_HOLE) |
2422 | 2422 |
2423 blink::WebMediaStream web_stream( | 2423 blink::WebMediaStream web_stream( |
2424 blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url)); | 2424 blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url)); |
2425 if (!web_stream.isNull()) | 2425 if (!web_stream.isNull()) |
2426 return CreateWebMediaPlayerForMediaStream(client, sink_id, | 2426 return CreateWebMediaPlayerForMediaStream(client, sink_id, |
2427 frame_->getSecurityOrigin()); | 2427 frame_->getSecurityOrigin()); |
2428 | 2428 |
2429 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 2429 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
2430 | 2430 |
2431 scoped_refptr<media::RestartableAudioRendererSink> audio_renderer_sink = | 2431 scoped_refptr<media::SwitchableAudioRendererSink> audio_renderer_sink = |
2432 AudioDeviceFactory::NewRestartableAudioRendererSink( | 2432 AudioDeviceFactory::NewSwitchableAudioRendererSink( |
2433 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, | 2433 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, |
2434 sink_id.utf8(), frame_->getSecurityOrigin()); | 2434 sink_id.utf8(), frame_->getSecurityOrigin()); |
2435 media::WebMediaPlayerParams::Context3DCB context_3d_cb = | 2435 media::WebMediaPlayerParams::Context3DCB context_3d_cb = |
2436 base::Bind(&GetSharedMainThreadContext3D); | 2436 base::Bind(&GetSharedMainThreadContext3D); |
2437 | 2437 |
2438 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog()); | 2438 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog()); |
2439 #if defined(OS_ANDROID) | 2439 #if defined(OS_ANDROID) |
2440 if (!media_surface_manager_) | 2440 if (!media_surface_manager_) |
2441 media_surface_manager_ = new RendererSurfaceViewManager(this); | 2441 media_surface_manager_ = new RendererSurfaceViewManager(this); |
2442 #endif | 2442 #endif |
(...skipping 3609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6052 RenderFrameImpl::GetWebMediaPlayerDelegate() { | 6052 RenderFrameImpl::GetWebMediaPlayerDelegate() { |
6053 if (!media_player_delegate_) | 6053 if (!media_player_delegate_) |
6054 media_player_delegate_ = new media::RendererWebMediaPlayerDelegate(this); | 6054 media_player_delegate_ = new media::RendererWebMediaPlayerDelegate(this); |
6055 return media_player_delegate_; | 6055 return media_player_delegate_; |
6056 } | 6056 } |
6057 | 6057 |
6058 void RenderFrameImpl::checkIfAudioSinkExistsAndIsAuthorized( | 6058 void RenderFrameImpl::checkIfAudioSinkExistsAndIsAuthorized( |
6059 const blink::WebString& sink_id, | 6059 const blink::WebString& sink_id, |
6060 const blink::WebSecurityOrigin& security_origin, | 6060 const blink::WebSecurityOrigin& security_origin, |
6061 blink::WebSetSinkIdCallbacks* web_callbacks) { | 6061 blink::WebSetSinkIdCallbacks* web_callbacks) { |
6062 media::SwitchOutputDeviceCB callback = | 6062 media::OutputDeviceStatusCB callback = |
6063 media::ConvertToSwitchOutputDeviceCB(web_callbacks); | 6063 media::ConvertToOutputDeviceStatusCB(web_callbacks); |
6064 callback.Run(AudioDeviceFactory::GetOutputDeviceStatus( | 6064 callback.Run(AudioDeviceFactory::GetOutputDeviceInfo( |
6065 routing_id_, 0, sink_id.utf8(), security_origin)); | 6065 routing_id_, 0, sink_id.utf8(), security_origin) |
| 6066 .device_status()); |
6066 } | 6067 } |
6067 | 6068 |
6068 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { | 6069 blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { |
6069 if (!is_main_frame_) | 6070 if (!is_main_frame_) |
6070 return nullptr; | 6071 return nullptr; |
6071 | 6072 |
6072 if (frame_->document().isPluginDocument()) | 6073 if (frame_->document().isPluginDocument()) |
6073 return frame_->document().to<WebPluginDocument>().plugin(); | 6074 return frame_->document().to<WebPluginDocument>().plugin(); |
6074 | 6075 |
6075 #if defined(ENABLE_PLUGINS) | 6076 #if defined(ENABLE_PLUGINS) |
6076 if (plugin_find_handler_) | 6077 if (plugin_find_handler_) |
6077 return plugin_find_handler_->container()->plugin(); | 6078 return plugin_find_handler_->container()->plugin(); |
6078 #endif | 6079 #endif |
6079 | 6080 |
6080 return nullptr; | 6081 return nullptr; |
6081 } | 6082 } |
6082 | 6083 |
6083 void RenderFrameImpl::SendFindReply(int request_id, | 6084 void RenderFrameImpl::SendFindReply(int request_id, |
6084 int match_count, | 6085 int match_count, |
6085 int ordinal, | 6086 int ordinal, |
6086 const WebRect& selection_rect, | 6087 const WebRect& selection_rect, |
6087 bool final_status_update) { | 6088 bool final_status_update) { |
6088 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6089 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
6089 selection_rect, ordinal, | 6090 selection_rect, ordinal, |
6090 final_status_update)); | 6091 final_status_update)); |
6091 } | 6092 } |
6092 | 6093 |
6093 } // namespace content | 6094 } // namespace content |
OLD | NEW |