| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "content/common/file_system/file_system_dispatcher.h" | 24 #include "content/common/file_system/file_system_dispatcher.h" |
| 25 #include "content/common/file_system_messages.h" | 25 #include "content/common/file_system_messages.h" |
| 26 #include "content/common/media/audio_messages.h" | 26 #include "content/common/media/audio_messages.h" |
| 27 #include "content/common/pepper_file_messages.h" | 27 #include "content/common/pepper_file_messages.h" |
| 28 #include "content/common/pepper_plugin_registry.h" | 28 #include "content/common/pepper_plugin_registry.h" |
| 29 #include "content/common/pepper_messages.h" | 29 #include "content/common/pepper_messages.h" |
| 30 #include "content/common/quota_dispatcher.h" | 30 #include "content/common/quota_dispatcher.h" |
| 31 #include "content/common/view_messages.h" | 31 #include "content/common/view_messages.h" |
| 32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
| 33 #include "content/public/renderer/content_renderer_client.h" | 33 #include "content/public/renderer/content_renderer_client.h" |
| 34 #include "content/renderer/gamepad_shared_memory_reader.h" |
| 34 #include "content/renderer/gpu/command_buffer_proxy.h" | 35 #include "content/renderer/gpu/command_buffer_proxy.h" |
| 35 #include "content/renderer/gpu/gpu_channel_host.h" | 36 #include "content/renderer/gpu/gpu_channel_host.h" |
| 36 #include "content/renderer/gpu/renderer_gl_context.h" | 37 #include "content/renderer/gpu/renderer_gl_context.h" |
| 37 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 38 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
| 38 #include "content/renderer/media/audio_input_message_filter.h" | 39 #include "content/renderer/media/audio_input_message_filter.h" |
| 39 #include "content/renderer/media/audio_message_filter.h" | 40 #include "content/renderer/media/audio_message_filter.h" |
| 40 #include "content/renderer/media/video_capture_impl_manager.h" | 41 #include "content/renderer/media/video_capture_impl_manager.h" |
| 41 #include "content/renderer/p2p/p2p_transport_impl.h" | 42 #include "content/renderer/p2p/p2p_transport_impl.h" |
| 42 #include "content/renderer/pepper_platform_context_3d_impl.h" | 43 #include "content/renderer/pepper_platform_context_3d_impl.h" |
| 43 #include "content/renderer/pepper_platform_video_decoder_impl.h" | 44 #include "content/renderer/pepper_platform_video_decoder_impl.h" |
| (...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 | 2029 |
| 2029 void PepperPluginDelegateImpl::DidReceiveMouseEvent( | 2030 void PepperPluginDelegateImpl::DidReceiveMouseEvent( |
| 2030 webkit::ppapi::PluginInstance* instance) { | 2031 webkit::ppapi::PluginInstance* instance) { |
| 2031 last_mouse_event_target_ = instance; | 2032 last_mouse_event_target_ = instance; |
| 2032 } | 2033 } |
| 2033 | 2034 |
| 2034 bool PepperPluginDelegateImpl::IsInFullscreenMode() { | 2035 bool PepperPluginDelegateImpl::IsInFullscreenMode() { |
| 2035 return render_view_->is_fullscreen(); | 2036 return render_view_->is_fullscreen(); |
| 2036 } | 2037 } |
| 2037 | 2038 |
| 2039 void PepperPluginDelegateImpl::SampleGamepads(WebKit::WebGamepads* data) { |
| 2040 if (!gamepad_shared_memory_reader_.get()) |
| 2041 gamepad_shared_memory_reader_.reset(new content::GamepadSharedMemoryReader); |
| 2042 gamepad_shared_memory_reader_->SampleGamepads(*data); |
| 2043 } |
| 2044 |
| 2038 bool PepperPluginDelegateImpl::IsPageVisible() const { | 2045 bool PepperPluginDelegateImpl::IsPageVisible() const { |
| 2039 return !render_view_->is_hidden(); | 2046 return !render_view_->is_hidden(); |
| 2040 } | 2047 } |
| 2041 | 2048 |
| 2042 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) { | 2049 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) { |
| 2043 bool handled = true; | 2050 bool handled = true; |
| 2044 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message) | 2051 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message) |
| 2045 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, | 2052 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, |
| 2046 OnTCPSocketConnectACK) | 2053 OnTCPSocketConnectACK) |
| 2047 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, | 2054 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2158 | 2165 |
| 2159 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { | 2166 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { |
| 2160 WebView* webview = render_view_->webview(); | 2167 WebView* webview = render_view_->webview(); |
| 2161 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; | 2168 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; |
| 2162 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); | 2169 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); |
| 2163 if (!url.is_valid()) | 2170 if (!url.is_valid()) |
| 2164 return false; | 2171 return false; |
| 2165 | 2172 |
| 2166 return content::GetContentClient()->renderer()->AllowSocketAPI(url); | 2173 return content::GetContentClient()->renderer()->AllowSocketAPI(url); |
| 2167 } | 2174 } |
| OLD | NEW |