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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10912062: Implement the gamepad API in the IPC proxy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « webkit/plugins/ppapi/event_conversion.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 15 matching lines...) Expand all
26 #include "ppapi/c/ppb_audio_config.h" 26 #include "ppapi/c/ppb_audio_config.h"
27 #include "ppapi/c/ppb_core.h" 27 #include "ppapi/c/ppb_core.h"
28 #include "ppapi/c/ppb_gamepad.h" 28 #include "ppapi/c/ppb_gamepad.h"
29 #include "ppapi/c/ppp_input_event.h" 29 #include "ppapi/c/ppp_input_event.h"
30 #include "ppapi/c/ppp_instance.h" 30 #include "ppapi/c/ppp_instance.h"
31 #include "ppapi/c/ppp_messaging.h" 31 #include "ppapi/c/ppp_messaging.h"
32 #include "ppapi/c/ppp_mouse_lock.h" 32 #include "ppapi/c/ppp_mouse_lock.h"
33 #include "ppapi/c/private/pp_content_decryptor.h" 33 #include "ppapi/c/private/pp_content_decryptor.h"
34 #include "ppapi/c/private/ppp_instance_private.h" 34 #include "ppapi/c/private/ppp_instance_private.h"
35 #include "ppapi/shared_impl/ppapi_preferences.h" 35 #include "ppapi/shared_impl/ppapi_preferences.h"
36 #include "ppapi/shared_impl/ppb_gamepad_shared.h"
36 #include "ppapi/shared_impl/ppb_input_event_shared.h" 37 #include "ppapi/shared_impl/ppb_input_event_shared.h"
37 #include "ppapi/shared_impl/ppb_url_util_shared.h" 38 #include "ppapi/shared_impl/ppb_url_util_shared.h"
38 #include "ppapi/shared_impl/ppb_view_shared.h" 39 #include "ppapi/shared_impl/ppb_view_shared.h"
39 #include "ppapi/shared_impl/ppp_instance_combined.h" 40 #include "ppapi/shared_impl/ppp_instance_combined.h"
40 #include "ppapi/shared_impl/resource.h" 41 #include "ppapi/shared_impl/resource.h"
41 #include "ppapi/shared_impl/scoped_pp_resource.h" 42 #include "ppapi/shared_impl/scoped_pp_resource.h"
42 #include "ppapi/shared_impl/time_conversion.h" 43 #include "ppapi/shared_impl/time_conversion.h"
43 #include "ppapi/shared_impl/var.h" 44 #include "ppapi/shared_impl/var.h"
44 #include "ppapi/thunk/enter.h" 45 #include "ppapi/thunk/enter.h"
45 #include "ppapi/thunk/ppb_buffer_api.h" 46 #include "ppapi/thunk/ppb_buffer_api.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 return new PluginInstance(delegate, module, ppp_instance_combined); 395 return new PluginInstance(delegate, module, ppp_instance_combined);
395 } 396 }
396 397
397 PluginInstance::GamepadImpl::GamepadImpl(PluginDelegate* delegate) 398 PluginInstance::GamepadImpl::GamepadImpl(PluginDelegate* delegate)
398 : delegate_(delegate) { 399 : delegate_(delegate) {
399 } 400 }
400 401
401 void PluginInstance::GamepadImpl::Sample(PP_GamepadsSampleData* data) { 402 void PluginInstance::GamepadImpl::Sample(PP_GamepadsSampleData* data) {
402 WebKit::WebGamepads webkit_data; 403 WebKit::WebGamepads webkit_data;
403 delegate_->SampleGamepads(&webkit_data); 404 delegate_->SampleGamepads(&webkit_data);
404 ConvertWebKitGamepadData(webkit_data, data); 405 ConvertWebKitGamepadData(
406 *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data);
405 } 407 }
406 408
407 PluginInstance::PluginInstance( 409 PluginInstance::PluginInstance(
408 PluginDelegate* delegate, 410 PluginDelegate* delegate,
409 PluginModule* module, 411 PluginModule* module,
410 ::ppapi::PPP_Instance_Combined* instance_interface) 412 ::ppapi::PPP_Instance_Combined* instance_interface)
411 : delegate_(delegate), 413 : delegate_(delegate),
412 module_(module), 414 module_(module),
413 instance_interface_(instance_interface), 415 instance_interface_(instance_interface),
414 pp_instance_(0), 416 pp_instance_(0),
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 screen_size_for_fullscreen_ = gfx::Size(); 2660 screen_size_for_fullscreen_ = gfx::Size();
2659 WebElement element = container_->element(); 2661 WebElement element = container_->element();
2660 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2662 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2661 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2663 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2662 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2664 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2663 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2665 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2664 } 2666 }
2665 2667
2666 } // namespace ppapi 2668 } // namespace ppapi
2667 } // namespace webkit 2669 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/event_conversion.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698