| 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 "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 Loading... |
| 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 Loading... |
| 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 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 screen_size_for_fullscreen_ = gfx::Size(); | 2641 screen_size_for_fullscreen_ = gfx::Size(); |
| 2640 WebElement element = container_->element(); | 2642 WebElement element = container_->element(); |
| 2641 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2643 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2642 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2644 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2643 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2645 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2644 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2646 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2645 } | 2647 } |
| 2646 | 2648 |
| 2647 } // namespace ppapi | 2649 } // namespace ppapi |
| 2648 } // namespace webkit | 2650 } // namespace webkit |
| OLD | NEW |