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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "base/strings/utf_offset_string_conversions.h" | 16 #include "base/strings/utf_offset_string_conversions.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "cc/base/latency_info_swap_promise.h" | 19 #include "cc/base/latency_info_swap_promise.h" |
20 #include "cc/layers/texture_layer.h" | 20 #include "cc/layers/texture_layer.h" |
21 #include "cc/trees/layer_tree_host.h" | 21 #include "cc/trees/layer_tree_host.h" |
22 #include "content/common/content_constants_internal.h" | 22 #include "content/common/content_constants_internal.h" |
23 #include "content/common/input/web_input_event_traits.h" | 23 #include "content/common/input/web_input_event_traits.h" |
24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
25 #include "content/public/common/page_zoom.h" | 25 #include "content/public/common/page_zoom.h" |
26 #include "content/public/renderer/content_renderer_client.h" | 26 #include "content/public/renderer/content_renderer_client.h" |
| 27 #include "content/renderer/compositor_bindings/web_layer_impl.h" |
27 #include "content/renderer/gpu/render_widget_compositor.h" | 28 #include "content/renderer/gpu/render_widget_compositor.h" |
28 #include "content/renderer/pepper/common.h" | 29 #include "content/renderer/pepper/common.h" |
29 #include "content/renderer/pepper/content_decryptor_delegate.h" | 30 #include "content/renderer/pepper/content_decryptor_delegate.h" |
30 #include "content/renderer/pepper/event_conversion.h" | 31 #include "content/renderer/pepper/event_conversion.h" |
31 #include "content/renderer/pepper/fullscreen_container.h" | 32 #include "content/renderer/pepper/fullscreen_container.h" |
32 #include "content/renderer/pepper/gfx_conversion.h" | 33 #include "content/renderer/pepper/gfx_conversion.h" |
33 #include "content/renderer/pepper/host_dispatcher_wrapper.h" | 34 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
34 #include "content/renderer/pepper/host_globals.h" | 35 #include "content/renderer/pepper/host_globals.h" |
35 #include "content/renderer/pepper/message_channel.h" | 36 #include "content/renderer/pepper/message_channel.h" |
36 #include "content/renderer/pepper/npapi_glue.h" | 37 #include "content/renderer/pepper/npapi_glue.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 #include "third_party/WebKit/public/web/WebView.h" | 120 #include "third_party/WebKit/public/web/WebView.h" |
120 #include "third_party/khronos/GLES2/gl2.h" | 121 #include "third_party/khronos/GLES2/gl2.h" |
121 #include "third_party/skia/include/core/SkCanvas.h" | 122 #include "third_party/skia/include/core/SkCanvas.h" |
122 #include "third_party/skia/include/core/SkRect.h" | 123 #include "third_party/skia/include/core/SkRect.h" |
123 #include "ui/gfx/image/image_skia.h" | 124 #include "ui/gfx/image/image_skia.h" |
124 #include "ui/gfx/image/image_skia_rep.h" | 125 #include "ui/gfx/image/image_skia_rep.h" |
125 #include "ui/gfx/range/range.h" | 126 #include "ui/gfx/range/range.h" |
126 #include "ui/gfx/rect_conversions.h" | 127 #include "ui/gfx/rect_conversions.h" |
127 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 128 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
128 #include "v8/include/v8.h" | 129 #include "v8/include/v8.h" |
129 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | |
130 | 130 |
131 #if defined(OS_CHROMEOS) | 131 #if defined(OS_CHROMEOS) |
132 #include "ui/events/keycodes/keyboard_codes_posix.h" | 132 #include "ui/events/keycodes/keyboard_codes_posix.h" |
133 #endif | 133 #endif |
134 | 134 |
135 #if defined(OS_MACOSX) | 135 #if defined(OS_MACOSX) |
136 #include "printing/metafile_impl.h" | 136 #include "printing/metafile_impl.h" |
137 #endif // defined(OS_MACOSX) | 137 #endif // defined(OS_MACOSX) |
138 | 138 |
139 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2032 bound_graphics_2d_platform_->AttachedToNewLayer(); | 2032 bound_graphics_2d_platform_->AttachedToNewLayer(); |
2033 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); | 2033 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); |
2034 texture_layer_->SetFlipped(false); | 2034 texture_layer_->SetFlipped(false); |
2035 } | 2035 } |
2036 | 2036 |
2037 // Ignore transparency in fullscreen, since that's what Flash always | 2037 // Ignore transparency in fullscreen, since that's what Flash always |
2038 // wants to do, and that lets it not recreate a context if | 2038 // wants to do, and that lets it not recreate a context if |
2039 // wmode=transparent was specified. | 2039 // wmode=transparent was specified. |
2040 opaque = opaque || fullscreen_container_; | 2040 opaque = opaque || fullscreen_container_; |
2041 texture_layer_->SetContentsOpaque(opaque); | 2041 texture_layer_->SetContentsOpaque(opaque); |
2042 web_layer_.reset(new webkit::WebLayerImpl(texture_layer_)); | 2042 web_layer_.reset(new WebLayerImpl(texture_layer_)); |
2043 } else if (want_compositor_layer) { | 2043 } else if (want_compositor_layer) { |
2044 compositor_layer_ = bound_compositor_->layer(); | 2044 compositor_layer_ = bound_compositor_->layer(); |
2045 web_layer_.reset(new webkit::WebLayerImpl(compositor_layer_)); | 2045 web_layer_.reset(new WebLayerImpl(compositor_layer_)); |
2046 } | 2046 } |
2047 | 2047 |
2048 if (web_layer_) { | 2048 if (web_layer_) { |
2049 if (fullscreen_container_) { | 2049 if (fullscreen_container_) { |
2050 fullscreen_container_->SetLayer(web_layer_.get()); | 2050 fullscreen_container_->SetLayer(web_layer_.get()); |
2051 } else { | 2051 } else { |
2052 container_->setWebLayer(web_layer_.get()); | 2052 container_->setWebLayer(web_layer_.get()); |
2053 } | 2053 } |
2054 } | 2054 } |
2055 | 2055 |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3274 // Running out-of-process. Initiate an IPC call to notify the plugin | 3274 // Running out-of-process. Initiate an IPC call to notify the plugin |
3275 // process. | 3275 // process. |
3276 ppapi::proxy::HostDispatcher* dispatcher = | 3276 ppapi::proxy::HostDispatcher* dispatcher = |
3277 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3277 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3278 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3278 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3279 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3279 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3280 } | 3280 } |
3281 } | 3281 } |
3282 | 3282 |
3283 } // namespace content | 3283 } // namespace content |
OLD | NEW |