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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #include "skia/ext/platform_canvas.h" | 86 #include "skia/ext/platform_canvas.h" |
87 #include "skia/ext/platform_device.h" | 87 #include "skia/ext/platform_device.h" |
88 #include "third_party/WebKit/public/platform/WebGamepads.h" | 88 #include "third_party/WebKit/public/platform/WebGamepads.h" |
89 #include "third_party/WebKit/public/platform/WebString.h" | 89 #include "third_party/WebKit/public/platform/WebString.h" |
90 #include "third_party/WebKit/public/platform/WebURL.h" | 90 #include "third_party/WebKit/public/platform/WebURL.h" |
91 #include "third_party/WebKit/public/platform/WebURLError.h" | 91 #include "third_party/WebKit/public/platform/WebURLError.h" |
92 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 92 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
93 #include "third_party/WebKit/public/web/WebBindings.h" | 93 #include "third_party/WebKit/public/web/WebBindings.h" |
94 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 94 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
95 #include "third_party/WebKit/public/web/WebCursorInfo.h" | 95 #include "third_party/WebKit/public/web/WebCursorInfo.h" |
| 96 #include "third_party/WebKit/public/web/WebDataSource.h" |
96 #include "third_party/WebKit/public/web/WebDocument.h" | 97 #include "third_party/WebKit/public/web/WebDocument.h" |
97 #include "third_party/WebKit/public/web/WebElement.h" | 98 #include "third_party/WebKit/public/web/WebElement.h" |
98 #include "third_party/WebKit/public/web/WebFrame.h" | 99 #include "third_party/WebKit/public/web/WebFrame.h" |
99 #include "third_party/WebKit/public/web/WebInputEvent.h" | 100 #include "third_party/WebKit/public/web/WebInputEvent.h" |
100 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 101 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
101 #include "third_party/WebKit/public/web/WebPrintParams.h" | 102 #include "third_party/WebKit/public/web/WebPrintParams.h" |
102 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 103 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
103 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 104 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
104 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 105 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
105 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 106 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
(...skipping 2391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2497 components); | 2498 components); |
2498 } | 2499 } |
2499 | 2500 |
2500 PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL( | 2501 PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL( |
2501 PP_Instance instance, | 2502 PP_Instance instance, |
2502 PP_URLComponents_Dev* components) { | 2503 PP_URLComponents_Dev* components) { |
2503 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, | 2504 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, |
2504 components); | 2505 components); |
2505 } | 2506 } |
2506 | 2507 |
| 2508 PP_Var PepperPluginInstanceImpl::GetPluginReferrerURL( |
| 2509 PP_Instance instance, |
| 2510 PP_URLComponents_Dev* components) { |
| 2511 WebKit::WebDocument document = container()->element().document(); |
| 2512 if (!full_frame_) |
| 2513 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(), |
| 2514 components); |
| 2515 WebFrame* frame = document.frame(); |
| 2516 if (!frame) |
| 2517 return PP_MakeUndefined(); |
| 2518 const WebURLRequest& request = frame->dataSource()->originalRequest(); |
| 2519 WebString referer = request.httpHeaderField("Referer"); |
| 2520 if (referer.isEmpty()) |
| 2521 return PP_MakeUndefined(); |
| 2522 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(GURL(referer), |
| 2523 components); |
| 2524 } |
| 2525 |
2507 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( | 2526 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( |
2508 scoped_refptr<PluginModule> module) { | 2527 scoped_refptr<PluginModule> module) { |
2509 // Save the original module and switch over to the new one now that this | 2528 // Save the original module and switch over to the new one now that this |
2510 // plugin is using the IPC-based proxy. | 2529 // plugin is using the IPC-based proxy. |
2511 original_module_ = module_; | 2530 original_module_ = module_; |
2512 module_ = module; | 2531 module_ = module; |
2513 | 2532 |
2514 // Don't send any messages to the plugin until DidCreate() has finished. | 2533 // Don't send any messages to the plugin until DidCreate() has finished. |
2515 message_channel_->QueueJavaScriptMessages(); | 2534 message_channel_->QueueJavaScriptMessages(); |
2516 | 2535 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 // Running out-of-process. Initiate an IPC call to notify the plugin | 2925 // Running out-of-process. Initiate an IPC call to notify the plugin |
2907 // process. | 2926 // process. |
2908 ppapi::proxy::HostDispatcher* dispatcher = | 2927 ppapi::proxy::HostDispatcher* dispatcher = |
2909 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2928 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
2910 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2929 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
2911 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2930 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
2912 } | 2931 } |
2913 } | 2932 } |
2914 | 2933 |
2915 } // namespace content | 2934 } // namespace content |
OLD | NEW |