Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 9085027: Pepper gamepad support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix example Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 2022
2022 void PepperPluginDelegateImpl::DidReceiveMouseEvent( 2023 void PepperPluginDelegateImpl::DidReceiveMouseEvent(
2023 webkit::ppapi::PluginInstance* instance) { 2024 webkit::ppapi::PluginInstance* instance) {
2024 last_mouse_event_target_ = instance; 2025 last_mouse_event_target_ = instance;
2025 } 2026 }
2026 2027
2027 bool PepperPluginDelegateImpl::IsInFullscreenMode() { 2028 bool PepperPluginDelegateImpl::IsInFullscreenMode() {
2028 return render_view_->is_fullscreen(); 2029 return render_view_->is_fullscreen();
2029 } 2030 }
2030 2031
2032 void PepperPluginDelegateImpl::SampleGamepads(WebKit::WebGamepads* data) {
2033 if (!gamepad_shared_memory_reader_.get())
2034 gamepad_shared_memory_reader_.reset(new content::GamepadSharedMemoryReader);
2035 gamepad_shared_memory_reader_->SampleGamepads(*data);
2036 }
2037
2031 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) { 2038 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) {
2032 bool handled = true; 2039 bool handled = true;
2033 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message) 2040 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message)
2034 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, 2041 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK,
2035 OnTCPSocketConnectACK) 2042 OnTCPSocketConnectACK)
2036 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, 2043 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK,
2037 OnTCPSocketSSLHandshakeACK) 2044 OnTCPSocketSSLHandshakeACK)
2038 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) 2045 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK)
2039 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) 2046 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK)
2040 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK) 2047 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK)
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2147 2154
2148 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { 2155 bool PepperPluginDelegateImpl::CanUseSocketAPIs() {
2149 WebView* webview = render_view_->webview(); 2156 WebView* webview = render_view_->webview();
2150 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; 2157 WebFrame* main_frame = webview ? webview->mainFrame() : NULL;
2151 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); 2158 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL());
2152 if (!url.is_valid()) 2159 if (!url.is_valid())
2153 return false; 2160 return false;
2154 2161
2155 return content::GetContentClient()->renderer()->AllowSocketAPI(url); 2162 return content::GetContentClient()->renderer()->AllowSocketAPI(url);
2156 } 2163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698