| 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_impl.h" | 5 #include "content/renderer/pepper/ppapi_plugin_instance_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/strings/utf_offset_string_conversions.h" | 15 #include "base/strings/utf_offset_string_conversions.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "cc/layers/texture_layer.h" | 18 #include "cc/layers/texture_layer.h" |
| 19 #include "content/renderer/pepper/common.h" |
| 20 #include "content/renderer/pepper/content_decryptor_delegate.h" |
| 21 #include "content/renderer/pepper/event_conversion.h" |
| 22 #include "content/renderer/pepper/fullscreen_container.h" |
| 23 #include "content/renderer/pepper/gfx_conversion.h" |
| 24 #include "content/renderer/pepper/host_globals.h" |
| 25 #include "content/renderer/pepper/message_channel.h" |
| 26 #include "content/renderer/pepper/npapi_glue.h" |
| 27 #include "content/renderer/pepper/plugin_module.h" |
| 28 #include "content/renderer/pepper/plugin_object.h" |
| 29 #include "content/renderer/pepper/ppb_buffer_impl.h" |
| 30 #include "content/renderer/pepper/ppb_file_ref_impl.h" |
| 31 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
| 32 #include "content/renderer/pepper/ppb_image_data_impl.h" |
| 33 #include "content/renderer/pepper/ppp_pdf.h" |
| 34 #include "content/renderer/pepper/url_request_info_util.h" |
| 19 #include "ppapi/c/dev/ppb_find_dev.h" | 35 #include "ppapi/c/dev/ppb_find_dev.h" |
| 20 #include "ppapi/c/dev/ppb_zoom_dev.h" | 36 #include "ppapi/c/dev/ppb_zoom_dev.h" |
| 21 #include "ppapi/c/dev/ppp_find_dev.h" | 37 #include "ppapi/c/dev/ppp_find_dev.h" |
| 22 #include "ppapi/c/dev/ppp_selection_dev.h" | 38 #include "ppapi/c/dev/ppp_selection_dev.h" |
| 23 #include "ppapi/c/dev/ppp_text_input_dev.h" | 39 #include "ppapi/c/dev/ppp_text_input_dev.h" |
| 24 #include "ppapi/c/dev/ppp_zoom_dev.h" | 40 #include "ppapi/c/dev/ppp_zoom_dev.h" |
| 25 #include "ppapi/c/pp_rect.h" | 41 #include "ppapi/c/pp_rect.h" |
| 26 #include "ppapi/c/ppb_audio_config.h" | 42 #include "ppapi/c/ppb_audio_config.h" |
| 27 #include "ppapi/c/ppb_core.h" | 43 #include "ppapi/c/ppb_core.h" |
| 28 #include "ppapi/c/ppb_gamepad.h" | 44 #include "ppapi/c/ppb_gamepad.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "third_party/WebKit/public/web/WebView.h" | 87 #include "third_party/WebKit/public/web/WebView.h" |
| 72 #include "third_party/skia/include/core/SkCanvas.h" | 88 #include "third_party/skia/include/core/SkCanvas.h" |
| 73 #include "third_party/skia/include/core/SkRect.h" | 89 #include "third_party/skia/include/core/SkRect.h" |
| 74 #include "ui/base/range/range.h" | 90 #include "ui/base/range/range.h" |
| 75 #include "ui/gfx/image/image_skia.h" | 91 #include "ui/gfx/image/image_skia.h" |
| 76 #include "ui/gfx/image/image_skia_rep.h" | 92 #include "ui/gfx/image/image_skia_rep.h" |
| 77 #include "ui/gfx/rect_conversions.h" | 93 #include "ui/gfx/rect_conversions.h" |
| 78 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 94 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 79 #include "v8/include/v8.h" | 95 #include "v8/include/v8.h" |
| 80 #include "webkit/plugins/plugin_constants.h" | 96 #include "webkit/plugins/plugin_constants.h" |
| 81 #include "webkit/plugins/ppapi/common.h" | |
| 82 #include "webkit/plugins/ppapi/content_decryptor_delegate.h" | |
| 83 #include "webkit/plugins/ppapi/event_conversion.h" | |
| 84 #include "webkit/plugins/ppapi/fullscreen_container.h" | |
| 85 #include "webkit/plugins/ppapi/gfx_conversion.h" | |
| 86 #include "webkit/plugins/ppapi/host_globals.h" | |
| 87 #include "webkit/plugins/ppapi/message_channel.h" | |
| 88 #include "webkit/plugins/ppapi/npapi_glue.h" | |
| 89 #include "webkit/plugins/ppapi/plugin_module.h" | |
| 90 #include "webkit/plugins/ppapi/plugin_object.h" | |
| 91 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | |
| 92 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" | |
| 93 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" | |
| 94 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | |
| 95 #include "webkit/plugins/ppapi/ppp_pdf.h" | |
| 96 #include "webkit/plugins/ppapi/url_request_info_util.h" | |
| 97 #include "webkit/plugins/sad_plugin.h" | 97 #include "webkit/plugins/sad_plugin.h" |
| 98 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 98 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
| 99 | 99 |
| 100 #if defined(OS_MACOSX) | 100 #if defined(OS_MACOSX) |
| 101 #include "printing/metafile_impl.h" | 101 #include "printing/metafile_impl.h" |
| 102 #endif // defined(OS_MACOSX) | 102 #endif // defined(OS_MACOSX) |
| 103 | 103 |
| 104 #if defined(OS_WIN) | 104 #if defined(OS_WIN) |
| 105 #include "base/metrics/histogram.h" | 105 #include "base/metrics/histogram.h" |
| 106 #include "base/win/windows_version.h" | 106 #include "base/win/windows_version.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 const WebURLError& error) { | 374 const WebURLError& error) { |
| 375 DCHECK(!error_.get()); | 375 DCHECK(!error_.get()); |
| 376 error_.reset(new WebURLError(error)); | 376 error_.reset(new WebURLError(error)); |
| 377 } | 377 } |
| 378 | 378 |
| 379 PluginInstanceImpl::GamepadImpl::GamepadImpl(PluginDelegate* delegate) | 379 PluginInstanceImpl::GamepadImpl::GamepadImpl(PluginDelegate* delegate) |
| 380 : Resource(::ppapi::Resource::Untracked()), | 380 : Resource(::ppapi::Resource::Untracked()), |
| 381 delegate_(delegate) { | 381 delegate_(delegate) { |
| 382 } | 382 } |
| 383 | 383 |
| 384 PluginInstanceImpl::GamepadImpl::~GamepadImpl() { |
| 385 } |
| 386 |
| 384 PPB_Gamepad_API* PluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() { | 387 PPB_Gamepad_API* PluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() { |
| 385 return this; | 388 return this; |
| 386 } | 389 } |
| 387 | 390 |
| 388 void PluginInstanceImpl::GamepadImpl::Sample(PP_Instance instance, | 391 void PluginInstanceImpl::GamepadImpl::Sample(PP_Instance instance, |
| 389 PP_GamepadsSampleData* data) { | 392 PP_GamepadsSampleData* data) { |
| 390 WebKit::WebGamepads webkit_data; | 393 WebKit::WebGamepads webkit_data; |
| 391 delegate_->SampleGamepads(&webkit_data); | 394 delegate_->SampleGamepads(&webkit_data); |
| 392 ConvertWebKitGamepadData( | 395 ConvertWebKitGamepadData( |
| 393 *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data); | 396 *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data); |
| (...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2714 screen_size_for_fullscreen_ = gfx::Size(); | 2717 screen_size_for_fullscreen_ = gfx::Size(); |
| 2715 WebElement element = container_->element(); | 2718 WebElement element = container_->element(); |
| 2716 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2719 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2717 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2720 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2718 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2721 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2719 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2722 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2720 } | 2723 } |
| 2721 | 2724 |
| 2722 } // namespace ppapi | 2725 } // namespace ppapi |
| 2723 } // namespace webkit | 2726 } // namespace webkit |
| OLD | NEW |