summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 02:18:48 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 02:18:48 +0000
commite23f046af41e813f02ee9ba1e0707cec6dc639ab (patch)
treed69b1d01dc46131c62d9109b7d800a1631733932 /webkit
parente3875f053e3b0aa977a324b39644f61cbd85ded7 (diff)
downloadchromium_src-e23f046af41e813f02ee9ba1e0707cec6dc639ab.zip
chromium_src-e23f046af41e813f02ee9ba1e0707cec6dc639ab.tar.gz
chromium_src-e23f046af41e813f02ee9ba1e0707cec6dc639ab.tar.bz2
Revert change 13558 and 13555 because they broke the plugin
tests and the test_shell_tests on linux. PLEASE back yourself out when you see you can't fix a bug instead of leaving it red for days. Review URL: http://codereview.chromium.org/67074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/activex_shim/activex_shared.cc13
-rw-r--r--webkit/activex_shim/activex_shared.h4
-rw-r--r--webkit/default_plugin/plugin_main.cc32
-rw-r--r--webkit/glue/plugins/plugin_list_win.cc14
-rw-r--r--webkit/glue/webframeloaderclient_impl.cc25
-rw-r--r--webkit/tools/test_shell/plugin_tests.cc28
-rwxr-xr-xwebkit/tools/test_shell/test_shell.cc10
7 files changed, 25 insertions, 101 deletions
diff --git a/webkit/activex_shim/activex_shared.cc b/webkit/activex_shim/activex_shared.cc
index 649ce01..c5b06a5 100644
--- a/webkit/activex_shim/activex_shared.cc
+++ b/webkit/activex_shim/activex_shared.cc
@@ -225,17 +225,4 @@ bool IsMimeTypeActiveX(const std::string& mimetype) {
LowerCaseEqualsASCII(mimetype, "application/oleobject");
}
-bool GetMimeTypeForClsid(const std::string& clsid, std::string* mime_type) {
- DCHECK(mime_type != NULL);
-
- if (!base::strcasecmp(clsid.c_str(),
- "6BF52A52-394A-11D3-B153-00C04F79FAA6") ||
- !base::strcasecmp(clsid.c_str(),
- "22D6F312-B0F6-11D0-94AB-0080C74C7E95")) {
- *mime_type = "application/x-mplayer2";
- return true;
- }
- return false;
-}
-
} // namespace activex_shim
diff --git a/webkit/activex_shim/activex_shared.h b/webkit/activex_shim/activex_shared.h
index 062dd8d..9b34dc9 100644
--- a/webkit/activex_shim/activex_shared.h
+++ b/webkit/activex_shim/activex_shared.h
@@ -61,10 +61,6 @@ bool IsCodebaseAllowed(const std::string& clsid, const std::string& codebase);
// "application/oleobject"
bool IsMimeTypeActiveX(const std::string& mimetype);
-// Returns the NPAPI mime type for the CLSID passed in. On failure
-// return false
-bool GetMimeTypeForClsid(const std::string& clsid, std::string* mime_type);
-
} // namespace activex_shim
#endif // #ifndef WEBKIT_ACTIVEX_SHIM_ACTIVEX_SHARED_H__
diff --git a/webkit/default_plugin/plugin_main.cc b/webkit/default_plugin/plugin_main.cc
index b0a24f8..f23a6f8 100644
--- a/webkit/default_plugin/plugin_main.cc
+++ b/webkit/default_plugin/plugin_main.cc
@@ -5,7 +5,6 @@
#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"
@@ -55,31 +54,6 @@ 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)
@@ -89,15 +63,9 @@ 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);
diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc
index b91c54d..02b1b94 100644
--- a/webkit/glue/plugins/plugin_list_win.cc
+++ b/webkit/glue/plugins/plugin_list_win.cc
@@ -211,6 +211,20 @@ void PluginList::PlatformInit() {
const PluginVersionInfo builtin_plugins[] = {
{
+ FilePath(kActiveXShimFileName),
+ L"ActiveX Plug-in",
+ L"ActiveX Plug-in provides a shim to support ActiveX controls",
+ L"1, 0, 0, 1",
+ L"application/x-oleobject|application/oleobject",
+ L"*|*",
+ L"",
+ {
+ activex_shim::ActiveX_Shim_NP_GetEntryPoints,
+ activex_shim::ActiveX_Shim_NP_Initialize,
+ activex_shim::ActiveX_Shim_NP_Shutdown
+ }
+ },
+ {
FilePath(kActiveXShimFileNameForMediaPlayer),
kActiveXShimFileNameForMediaPlayer,
L"Windows Media Player",
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc
index fb44f4d..29407d9 100644
--- a/webkit/glue/webframeloaderclient_impl.cc
+++ b/webkit/glue/webframeloaderclient_impl.cc
@@ -1447,21 +1447,16 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, // TODO(erikkay)
webkit_glue::CStringToStdString(param_values[i].latin1()));
}
}
-
- // Attempt to map this clsid to a known NPAPI mime type if possible, failing
- // which we attempt to load the activex shim for the clsid.
- if (!activex_shim::GetMimeTypeForClsid(clsid, &my_mime_type)) {
- // We only allowed specific ActiveX controls to run from certain websites.
- if (!activex_shim::IsActiveXAllowed(clsid, url))
- return NULL;
- // We need to pass the combined clsid + version to PluginsList, so that it
- // would detect if the requested version is installed. If not, it needs
- // to use the default plugin to update the control.
- if (!version.empty())
- combined_clsid = clsid + "#" + version;
- else
- combined_clsid = clsid;
- }
+ // We only allowed specific ActiveX controls to run from certain websites.
+ if (!activex_shim::IsActiveXAllowed(clsid, url))
+ return NULL;
+ // We need to pass the combined clsid + version to PluginsList, so that it
+ // would detect if the requested version is installed. If not, it needs
+ // to use the default plugin to update the control.
+ if (!version.empty())
+ combined_clsid = clsid + "#" + version;
+ else
+ combined_clsid = clsid;
}
#endif
diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc
index f2ad349..d5ac5ca 100644
--- a/webkit/tools/test_shell/plugin_tests.cc
+++ b/webkit/tools/test_shell/plugin_tests.cc
@@ -95,31 +95,3 @@ TEST_F(PluginTest, Refresh) {
DeleteTestPlugin();
}
-
-TEST_F(PluginTest, DefaultPluginLoadTest) {
- std::string html = "\
- <div id='result'>Test running....</div>\
- <script>\
- function onSuccess() {\
- var result = document.getElementById('result');\
- result.innerHTML = 'DONE';\
- }\
- </script>\
- <DIV ID=PluginDiv>\
- <object classid=\"clsid:9E8BC6CE-AF35-400c-ABF6-A3F746A1871D\">\
- <embed type=\"application/chromium-test-default-plugin\"\
- mode=\"np_embed\"\
- ></embed>\
- </object>\
- </DIV>\
- ";
-
- test_shell_->webView()->GetMainFrame()->LoadHTMLString(
- html, GURL("about:blank"));
- test_shell_->WaitTestFinished();
-
- std::wstring text;
- test_shell_->webView()->GetMainFrame()->GetContentAsPlainText(10000, &text);
-
- ASSERT_EQ(true, StartsWith(text, L"DONE", true));
-}
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 3e8af04..6ce2509 100755
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -7,7 +7,7 @@
#include "webkit/tools/test_shell/test_shell.h"
-#include "base/base_paths.h"
+
#include "base/command_line.h"
#include "base/debug_on_start.h"
#include "base/file_path.h"
@@ -614,14 +614,6 @@ bool GetPluginFinderURL(std::string* plugin_finder_url) {
#if !defined(LINUX2)
bool IsDefaultPluginEnabled() {
- FilePath exe_path;
-
- if (PathService::Get(base::FILE_EXE, &exe_path)) {
- std::wstring exe_name = file_util::GetFilenameFromPath(
- exe_path.ToWStringHack());
- if (StartsWith(exe_name, L"test_shell_tests", false))
- return true;
- }
return false;
}