| 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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 components); | 2492 components); |
| 2492 } | 2493 } |
| 2493 | 2494 |
| 2494 PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL( | 2495 PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL( |
| 2495 PP_Instance instance, | 2496 PP_Instance instance, |
| 2496 PP_URLComponents_Dev* components) { | 2497 PP_URLComponents_Dev* components) { |
| 2497 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, | 2498 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, |
| 2498 components); | 2499 components); |
| 2499 } | 2500 } |
| 2500 | 2501 |
| 2502 PP_Var PepperPluginInstanceImpl::GetPluginRefererURL( |
| 2503 PP_Instance instance, |
| 2504 PP_URLComponents_Dev* components) { |
| 2505 WebFrame* frame = container_->element().document().frame(); |
| 2506 if (!frame) |
| 2507 return PP_MakeUndefined(); |
| 2508 const WebURLRequest& request = frame->dataSource()->originalRequest(); |
| 2509 WebString referer = request.httpHeaderField("Referer"); |
| 2510 if (referer.isEmpty()) |
| 2511 return PP_MakeUndefined(); |
| 2512 return ::ppapi::PPB_URLUtil_Shared::GenerateURLReturn(GURL(referer), |
| 2513 components); |
| 2514 } |
| 2515 |
| 2501 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( | 2516 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( |
| 2502 scoped_refptr<PluginModule> module) { | 2517 scoped_refptr<PluginModule> module) { |
| 2503 // Save the original module and switch over to the new one now that this | 2518 // Save the original module and switch over to the new one now that this |
| 2504 // plugin is using the IPC-based proxy. | 2519 // plugin is using the IPC-based proxy. |
| 2505 original_module_ = module_; | 2520 original_module_ = module_; |
| 2506 module_ = module; | 2521 module_ = module; |
| 2507 | 2522 |
| 2508 // Don't send any messages to the plugin until DidCreate() has finished. | 2523 // Don't send any messages to the plugin until DidCreate() has finished. |
| 2509 message_channel_->QueueJavaScriptMessages(); | 2524 message_channel_->QueueJavaScriptMessages(); |
| 2510 | 2525 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2900 // Running out-of-process. Initiate an IPC call to notify the plugin | 2915 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 2901 // process. | 2916 // process. |
| 2902 ppapi::proxy::HostDispatcher* dispatcher = | 2917 ppapi::proxy::HostDispatcher* dispatcher = |
| 2903 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2918 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 2904 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2919 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 2905 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2920 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 2906 } | 2921 } |
| 2907 } | 2922 } |
| 2908 | 2923 |
| 2909 } // namespace content | 2924 } // namespace content |
| OLD | NEW |