| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/plugin/npobject_proxy.h" | 5 #include "chrome/plugin/npobject_proxy.h" |
| 6 | 6 |
| 7 #include "chrome/common/plugin_messages.h" | 7 #include "chrome/common/plugin_messages.h" |
| 8 #include "chrome/plugin/npobject_util.h" | 8 #include "chrome/plugin/npobject_util.h" |
| 9 #include "chrome/plugin/plugin_channel.h" | 9 #include "chrome/plugin/plugin_channel.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" |
| 11 #include "webkit/glue/webkit_glue.h" | 11 #include "webkit/glue/webkit_glue.h" |
| 12 #include "webkit/plugins/npapi/plugin_instance.h" | 12 #include "webkit/glue/plugins/plugin_instance.h" |
| 13 | 13 |
| 14 using WebKit::WebBindings; | 14 using WebKit::WebBindings; |
| 15 | 15 |
| 16 struct NPObjectWrapper { | 16 struct NPObjectWrapper { |
| 17 NPObject object; | 17 NPObject object; |
| 18 NPObjectProxy* proxy; | 18 NPObjectProxy* proxy; |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 NPClass NPObjectProxy::npclass_proxy_ = { | 21 NPClass NPObjectProxy::npclass_proxy_ = { |
| 22 NP_CLASS_STRUCT_VERSION, | 22 NP_CLASS_STRUCT_VERSION, |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 NPObjectProxy* proxy = GetProxy(obj); | 453 NPObjectProxy* proxy = GetProxy(obj); |
| 454 if (!proxy) { | 454 if (!proxy) { |
| 455 return false; | 455 return false; |
| 456 } | 456 } |
| 457 | 457 |
| 458 bool result = false; | 458 bool result = false; |
| 459 gfx::NativeViewId containing_window = proxy->containing_window_; | 459 gfx::NativeViewId containing_window = proxy->containing_window_; |
| 460 bool popups_allowed = false; | 460 bool popups_allowed = false; |
| 461 | 461 |
| 462 if (npp) { | 462 if (npp) { |
| 463 webkit::npapi::PluginInstance* plugin_instance = | 463 NPAPI::PluginInstance* plugin_instance = |
| 464 reinterpret_cast<webkit::npapi::PluginInstance*>(npp->ndata); | 464 reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata); |
| 465 if (plugin_instance) | 465 if (plugin_instance) |
| 466 popups_allowed = plugin_instance->popups_allowed(); | 466 popups_allowed = plugin_instance->popups_allowed(); |
| 467 } | 467 } |
| 468 | 468 |
| 469 NPVariant_Param result_param; | 469 NPVariant_Param result_param; |
| 470 std::string script_str = std::string( | 470 std::string script_str = std::string( |
| 471 script->UTF8Characters, script->UTF8Length); | 471 script->UTF8Characters, script->UTF8Length); |
| 472 | 472 |
| 473 NPObjectMsg_Evaluate* msg = new NPObjectMsg_Evaluate(proxy->route_id(), | 473 NPObjectMsg_Evaluate* msg = new NPObjectMsg_Evaluate(proxy->route_id(), |
| 474 script_str, | 474 script_str, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 490 proxy->Send(msg); | 490 proxy->Send(msg); |
| 491 // Send may delete proxy. | 491 // Send may delete proxy. |
| 492 proxy = NULL; | 492 proxy = NULL; |
| 493 if (!result) | 493 if (!result) |
| 494 return false; | 494 return false; |
| 495 | 495 |
| 496 CreateNPVariant( | 496 CreateNPVariant( |
| 497 result_param, channel.get(), result_var, containing_window, page_url); | 497 result_param, channel.get(), result_var, containing_window, page_url); |
| 498 return true; | 498 return true; |
| 499 } | 499 } |
| OLD | NEW |