summaryrefslogtreecommitdiffstats
path: root/webkit/default_plugin
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-11 00:50:12 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-11 00:50:12 +0000
commit93273a6c861a2d1579f0b26a545fcd544d825633 (patch)
tree0531ac0f4376a55b75b5ae3dffbb932a301ed793 /webkit/default_plugin
parent44e47865602da312b1aae90c278cf72abe7bc525 (diff)
downloadchromium_src-93273a6c861a2d1579f0b26a545fcd544d825633.zip
chromium_src-93273a6c861a2d1579f0b26a545fcd544d825633.tar.gz
chromium_src-93273a6c861a2d1579f0b26a545fcd544d825633.tar.bz2
Remove the Activex shim registration for generic Activex controls. The Activex shim only handles windows media
player in the wild and will continue to do so for the forseeable future. This fixes http://code.google.com/p/chromium/issues/detail?id=8584, which is basically related to our NPAPI plugin installer not getting instantiated on pages which instantiated flash using an object tag, which would result in webkit attempting to instantiate the activex shim. The shim only loads the windows media player classid, thus causing this issue. Added a test shell test which tests whether the default plugin loaded correctly. This is done by attempting to instantiate a special mime type application/chromium-test-default-plugin, which serves as an indicator to the default plugin to call a function in the page indicating that the test succeeded. I also made a change to ensure that the default plugin is loaded in test_shell_tests. Removed the activexshim dll project from chrome.sln Bug=8584 Review URL: http://codereview.chromium.org/63151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/default_plugin')
-rw-r--r--webkit/default_plugin/plugin_main.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/webkit/default_plugin/plugin_main.cc b/webkit/default_plugin/plugin_main.cc
index f23a6f8..b0a24f8 100644
--- a/webkit/default_plugin/plugin_main.cc
+++ b/webkit/default_plugin/plugin_main.cc
@@ -5,6 +5,7 @@
#include "webkit/default_plugin/plugin_main.h"
#include "base/logging.h"
+#include "base/string_util.h"
#include "webkit/activex_shim/npp_impl.h"
#include "webkit/default_plugin/plugin_impl.h"
#include "webkit/glue/webkit_glue.h"
@@ -54,6 +55,31 @@ NPError API_CALL NP_Shutdown(void) {
return 0;
}
+namespace {
+// This function is only invoked when the default plugin is invoked
+// with a special mime type application/chromium-test-default-plugin
+void SignalTestResult(NPP instance) {
+ NPObject *window_obj = NULL;
+ g_browser->getvalue(instance, NPNVWindowNPObject, &window_obj);
+ if (!window_obj) {
+ NOTREACHED();
+ return;
+ }
+
+ std::string script = "javascript:onSuccess()";
+ NPString script_string;
+ script_string.UTF8Characters = script.c_str();
+ script_string.UTF8Length =
+ static_cast<unsigned int>(script.length());
+
+ NPVariant result_var;
+ NPError result = g_browser->evaluate(instance, window_obj,
+ &script_string, &result_var);
+ g_browser->releaseobject(window_obj);
+}
+
+} // namespace CHROMIUM_DefaultPluginTest
+
NPError NPP_New(NPMIMEType plugin_type, NPP instance, uint16 mode, int16 argc,
char* argn[], char* argv[], NPSavedData* saved) {
if (instance == NULL)
@@ -63,9 +89,15 @@ NPError NPP_New(NPMIMEType plugin_type, NPP instance, uint16 mode, int16 argc,
// 1. Test-shell
// 2. The plugin is running in the renderer process.
if (webkit_glue::IsPluginRunningInRendererProcess()) {
+ if (!base::strcasecmp(plugin_type,
+ "application/chromium-test-default-plugin")) {
+ SignalTestResult(instance);
+ return NPERR_NO_ERROR;
+ }
return NPERR_GENERIC_ERROR;
}
+
PluginInstallerImpl* plugin_impl = new PluginInstallerImpl(mode);
plugin_impl->Initialize(GetCurrentModuleHandle(), instance, plugin_type, argc,
argn, argv);