| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/child/npobject_util.h" | 5 #include "content/child/npobject_util.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "content/child/np_channel_base.h" | 8 #include "content/child/np_channel_base.h" |
| 9 #include "content/child/npapi/plugin_host.h" |
| 9 #include "content/child/npobject_proxy.h" | 10 #include "content/child/npobject_proxy.h" |
| 10 #include "content/child/plugin_messages.h" | 11 #include "content/child/plugin_messages.h" |
| 11 #include "third_party/WebKit/public/web/WebBindings.h" | 12 #include "third_party/WebKit/public/web/WebBindings.h" |
| 12 #include "third_party/npapi/bindings/nphostapi.h" | 13 #include "third_party/npapi/bindings/nphostapi.h" |
| 13 #include "webkit/glue/webkit_glue.h" | 14 #include "webkit/glue/webkit_glue.h" |
| 14 #include "webkit/plugins/npapi/plugin_host.h" | |
| 15 | 15 |
| 16 using WebKit::WebBindings; | 16 using WebKit::WebBindings; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 // true if the current process is a plugin process, false otherwise. | 20 // true if the current process is a plugin process, false otherwise. |
| 21 static bool g_plugin_process; | 21 static bool g_plugin_process; |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 // The next 7 functions are called by the plugin code when it's using the | 24 // The next 7 functions are called by the plugin code when it's using the |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 init = true; | 123 init = true; |
| 124 return &host_funcs; | 124 return &host_funcs; |
| 125 } | 125 } |
| 126 | 126 |
| 127 } | 127 } |
| 128 | 128 |
| 129 void PatchNPNFunctions() { | 129 void PatchNPNFunctions() { |
| 130 g_plugin_process = true; | 130 g_plugin_process = true; |
| 131 NPNetscapeFuncs* funcs = GetHostFunctions(); | 131 NPNetscapeFuncs* funcs = GetHostFunctions(); |
| 132 webkit::npapi::PluginHost::Singleton()->PatchNPNetscapeFuncs(funcs); | 132 PluginHost::Singleton()->PatchNPNetscapeFuncs(funcs); |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool IsPluginProcess() { | 135 bool IsPluginProcess() { |
| 136 return g_plugin_process; | 136 return g_plugin_process; |
| 137 } | 137 } |
| 138 | 138 |
| 139 void CreateNPIdentifierParam(NPIdentifier id, NPIdentifier_Param* param) { | 139 void CreateNPIdentifierParam(NPIdentifier id, NPIdentifier_Param* param) { |
| 140 param->identifier = id; | 140 param->identifier = id; |
| 141 } | 141 } |
| 142 | 142 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 WebBindings::retainObject(result->value.objectValue); | 293 WebBindings::retainObject(result->value.objectValue); |
| 294 break; | 294 break; |
| 295 } | 295 } |
| 296 default: | 296 default: |
| 297 NOTREACHED(); | 297 NOTREACHED(); |
| 298 } | 298 } |
| 299 return true; | 299 return true; |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace content | 302 } // namespace content |
| OLD | NEW |