| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bit_cast.h" | 10 #include "base/bit_cast.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 #include "third_party/WebKit/public/platform/URLConversion.h" | 96 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 97 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 97 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 98 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 98 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 99 #include "third_party/WebKit/public/platform/WebGamepads.h" | 99 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 100 #include "third_party/WebKit/public/platform/WebRect.h" | 100 #include "third_party/WebKit/public/platform/WebRect.h" |
| 101 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 101 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 102 #include "third_party/WebKit/public/platform/WebString.h" | 102 #include "third_party/WebKit/public/platform/WebString.h" |
| 103 #include "third_party/WebKit/public/platform/WebURL.h" | 103 #include "third_party/WebKit/public/platform/WebURL.h" |
| 104 #include "third_party/WebKit/public/platform/WebURLError.h" | 104 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 105 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 105 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 106 #include "third_party/WebKit/public/web/WebBindings.h" | |
| 107 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 106 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 108 #include "third_party/WebKit/public/web/WebDataSource.h" | 107 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 109 #include "third_party/WebKit/public/web/WebDocument.h" | 108 #include "third_party/WebKit/public/web/WebDocument.h" |
| 110 #include "third_party/WebKit/public/web/WebInputEvent.h" | 109 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 111 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 110 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 112 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 111 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 113 #include "third_party/WebKit/public/web/WebPluginScriptForbiddenScope.h" | 112 #include "third_party/WebKit/public/web/WebPluginScriptForbiddenScope.h" |
| 114 #include "third_party/WebKit/public/web/WebPrintParams.h" | 113 #include "third_party/WebKit/public/web/WebPrintParams.h" |
| 115 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h" | 114 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h" |
| 116 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 115 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 using ppapi::TrackedCallback; | 149 using ppapi::TrackedCallback; |
| 151 using ppapi::thunk::EnterResourceNoLock; | 150 using ppapi::thunk::EnterResourceNoLock; |
| 152 using ppapi::thunk::PPB_Buffer_API; | 151 using ppapi::thunk::PPB_Buffer_API; |
| 153 using ppapi::thunk::PPB_Gamepad_API; | 152 using ppapi::thunk::PPB_Gamepad_API; |
| 154 using ppapi::thunk::PPB_Graphics2D_API; | 153 using ppapi::thunk::PPB_Graphics2D_API; |
| 155 using ppapi::thunk::PPB_Graphics3D_API; | 154 using ppapi::thunk::PPB_Graphics3D_API; |
| 156 using ppapi::thunk::PPB_ImageData_API; | 155 using ppapi::thunk::PPB_ImageData_API; |
| 157 using ppapi::Var; | 156 using ppapi::Var; |
| 158 using ppapi::ArrayBufferVar; | 157 using ppapi::ArrayBufferVar; |
| 159 using ppapi::ViewData; | 158 using ppapi::ViewData; |
| 160 using blink::WebBindings; | |
| 161 using blink::WebCanvas; | 159 using blink::WebCanvas; |
| 162 using blink::WebCursorInfo; | 160 using blink::WebCursorInfo; |
| 163 using blink::WebDocument; | 161 using blink::WebDocument; |
| 164 using blink::WebElement; | 162 using blink::WebElement; |
| 165 using blink::WebFrame; | 163 using blink::WebFrame; |
| 166 using blink::WebInputEvent; | 164 using blink::WebInputEvent; |
| 167 using blink::WebLocalFrame; | 165 using blink::WebLocalFrame; |
| 168 using blink::WebPlugin; | 166 using blink::WebPlugin; |
| 169 using blink::WebPluginContainer; | 167 using blink::WebPluginContainer; |
| 170 using blink::WebPrintParams; | 168 using blink::WebPrintParams; |
| (...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2355 PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance, | 2353 PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance, |
| 2356 PP_Var script_var, | 2354 PP_Var script_var, |
| 2357 PP_Var* exception) { | 2355 PP_Var* exception) { |
| 2358 if (!container_) | 2356 if (!container_) |
| 2359 return PP_MakeUndefined(); | 2357 return PP_MakeUndefined(); |
| 2360 if (is_deleted_ && blink::WebPluginScriptForbiddenScope::isForbidden()) | 2358 if (is_deleted_ && blink::WebPluginScriptForbiddenScope::isForbidden()) |
| 2361 return PP_MakeUndefined(); | 2359 return PP_MakeUndefined(); |
| 2362 RecordFlashJavaScriptUse(); | 2360 RecordFlashJavaScriptUse(); |
| 2363 | 2361 |
| 2364 // Executing the script may remove the plugin from the DOM, so we need to keep | 2362 // Executing the script may remove the plugin from the DOM, so we need to keep |
| 2365 // a reference to ourselves so that we can still process the result after the | 2363 // a reference to ourselves so that we can still process the result after |
| 2366 // WebBindings::evaluate() below. | 2364 // running the script below. |
| 2367 scoped_refptr<PepperPluginInstanceImpl> ref(this); | 2365 scoped_refptr<PepperPluginInstanceImpl> ref(this); |
| 2368 V8VarConverter converter(pp_instance_, V8VarConverter::kAllowObjectVars); | 2366 V8VarConverter converter(pp_instance_, V8VarConverter::kAllowObjectVars); |
| 2369 PepperTryCatchVar try_catch(this, &converter, exception); | 2367 PepperTryCatchVar try_catch(this, &converter, exception); |
| 2370 | 2368 |
| 2371 // Check for an exception due to the context being destroyed. | 2369 // Check for an exception due to the context being destroyed. |
| 2372 if (try_catch.HasException()) | 2370 if (try_catch.HasException()) |
| 2373 return PP_MakeUndefined(); | 2371 return PP_MakeUndefined(); |
| 2374 | 2372 |
| 2375 WebLocalFrame* frame = container_->element().document().frame(); | 2373 WebLocalFrame* frame = container_->element().document().frame(); |
| 2376 if (!frame) { | 2374 if (!frame) { |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3324 } | 3322 } |
| 3325 | 3323 |
| 3326 void PepperPluginInstanceImpl::ConvertDIPToViewport(gfx::Rect* rect) const { | 3324 void PepperPluginInstanceImpl::ConvertDIPToViewport(gfx::Rect* rect) const { |
| 3327 rect->set_x(rect->x() / viewport_to_dip_scale_); | 3325 rect->set_x(rect->x() / viewport_to_dip_scale_); |
| 3328 rect->set_y(rect->y() / viewport_to_dip_scale_); | 3326 rect->set_y(rect->y() / viewport_to_dip_scale_); |
| 3329 rect->set_width(rect->width() / viewport_to_dip_scale_); | 3327 rect->set_width(rect->width() / viewport_to_dip_scale_); |
| 3330 rect->set_height(rect->height() / viewport_to_dip_scale_); | 3328 rect->set_height(rect->height() / viewport_to_dip_scale_); |
| 3331 } | 3329 } |
| 3332 | 3330 |
| 3333 } // namespace content | 3331 } // namespace content |
| OLD | NEW |