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 #include "ppapi/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/pp_time.h" | 8 #include "ppapi/c/pp_time.h" |
9 #include "ppapi/c/pp_var.h" | 9 #include "ppapi/c/pp_var.h" |
10 #include "ppapi/c/ppb_audio_config.h" | 10 #include "ppapi/c/ppb_audio_config.h" |
11 #include "ppapi/c/ppb_instance.h" | 11 #include "ppapi/c/ppb_instance.h" |
12 #include "ppapi/c/ppb_messaging.h" | 12 #include "ppapi/c/ppb_messaging.h" |
13 #include "ppapi/c/ppb_mouse_lock.h" | 13 #include "ppapi/c/ppb_mouse_lock.h" |
14 #include "ppapi/c/private/pp_content_decryptor.h" | 14 #include "ppapi/c/private/pp_content_decryptor.h" |
15 #include "ppapi/proxy/content_decryptor_private_serializer.h" | 15 #include "ppapi/proxy/content_decryptor_private_serializer.h" |
16 #include "ppapi/proxy/enter_proxy.h" | 16 #include "ppapi/proxy/enter_proxy.h" |
| 17 #include "ppapi/proxy/gamepad_resource.h" |
17 #include "ppapi/proxy/host_dispatcher.h" | 18 #include "ppapi/proxy/host_dispatcher.h" |
18 #include "ppapi/proxy/plugin_dispatcher.h" | 19 #include "ppapi/proxy/plugin_dispatcher.h" |
19 #include "ppapi/proxy/plugin_proxy_delegate.h" | 20 #include "ppapi/proxy/plugin_proxy_delegate.h" |
20 #include "ppapi/proxy/ppapi_messages.h" | 21 #include "ppapi/proxy/ppapi_messages.h" |
21 #include "ppapi/proxy/ppb_flash_proxy.h" | 22 #include "ppapi/proxy/ppb_flash_proxy.h" |
22 #include "ppapi/proxy/serialized_var.h" | 23 #include "ppapi/proxy/serialized_var.h" |
23 #include "ppapi/shared_impl/ppapi_globals.h" | 24 #include "ppapi/shared_impl/ppapi_globals.h" |
24 #include "ppapi/shared_impl/ppb_url_util_shared.h" | 25 #include "ppapi/shared_impl/ppb_url_util_shared.h" |
25 #include "ppapi/shared_impl/ppb_view_shared.h" | 26 #include "ppapi/shared_impl/ppb_view_shared.h" |
26 #include "ppapi/shared_impl/var.h" | 27 #include "ppapi/shared_impl/var.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize( | 308 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize( |
308 API_ID_PPB_INSTANCE, instance, &result, size)); | 309 API_ID_PPB_INSTANCE, instance, &result, size)); |
309 return result; | 310 return result; |
310 } | 311 } |
311 | 312 |
312 thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() { | 313 thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() { |
313 InterfaceProxy* ip = dispatcher()->GetInterfaceProxy(API_ID_PPB_FLASH); | 314 InterfaceProxy* ip = dispatcher()->GetInterfaceProxy(API_ID_PPB_FLASH); |
314 return static_cast<PPB_Flash_Proxy*>(ip); | 315 return static_cast<PPB_Flash_Proxy*>(ip); |
315 } | 316 } |
316 | 317 |
317 void PPB_Instance_Proxy::SampleGamepads(PP_Instance instance, | 318 thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI( |
318 PP_GamepadsSampleData* data) { | 319 PP_Instance instance) { |
319 NOTIMPLEMENTED(); | 320 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 321 GetInstanceData(instance); |
| 322 if (!data) |
| 323 return NULL; |
| 324 |
| 325 if (!data->gamepad_resource.get()) { |
| 326 Connection connection( |
| 327 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), |
| 328 dispatcher()); |
| 329 data->gamepad_resource = new GamepadResource(connection, instance); |
| 330 } |
| 331 return data->gamepad_resource.get(); |
320 } | 332 } |
321 | 333 |
322 int32_t PPB_Instance_Proxy::RequestInputEvents(PP_Instance instance, | 334 int32_t PPB_Instance_Proxy::RequestInputEvents(PP_Instance instance, |
323 uint32_t event_classes) { | 335 uint32_t event_classes) { |
324 dispatcher()->Send(new PpapiHostMsg_PPBInstance_RequestInputEvents( | 336 dispatcher()->Send(new PpapiHostMsg_PPBInstance_RequestInputEvents( |
325 API_ID_PPB_INSTANCE, instance, false, event_classes)); | 337 API_ID_PPB_INSTANCE, instance, false, event_classes)); |
326 | 338 |
327 // We always register for the classes we can handle, this function validates | 339 // We always register for the classes we can handle, this function validates |
328 // the flags so we can notify it if anything was invalid, without requiring | 340 // the flags so we can notify it if anything was invalid, without requiring |
329 // a sync reply. | 341 // a sync reply. |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 PP_Instance instance) { | 1065 PP_Instance instance) { |
1054 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1066 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1055 GetInstanceData(instance); | 1067 GetInstanceData(instance); |
1056 if (!data) | 1068 if (!data) |
1057 return; // Instance was probably deleted. | 1069 return; // Instance was probably deleted. |
1058 data->should_do_request_surrounding_text = false; | 1070 data->should_do_request_surrounding_text = false; |
1059 } | 1071 } |
1060 | 1072 |
1061 } // namespace proxy | 1073 } // namespace proxy |
1062 } // namespace ppapi | 1074 } // namespace ppapi |
OLD | NEW |