diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-08 19:46:18 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-08 19:46:18 +0000 |
commit | 610c089bd27051ca8d2b983e784b31c533cbfef8 (patch) | |
tree | 5405ca268d1302facfa03b84f75b1ca3240fdb52 /webkit/glue/plugins | |
parent | f0f9663246d5bd8a2d03721d7390bdb2db244e18 (diff) | |
download | chromium_src-610c089bd27051ca8d2b983e784b31c533cbfef8.zip chromium_src-610c089bd27051ca8d2b983e784b31c533cbfef8.tar.gz chromium_src-610c089bd27051ca8d2b983e784b31c533cbfef8.tar.bz2 |
Take out the activex control.BUG=20259
Review URL: http://codereview.chromium.org/200031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/plugin_constants_win.h | 12 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list.cc | 32 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list.h | 22 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list_linux.cc | 4 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list_mac.mm | 4 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list_win.cc | 63 |
6 files changed, 23 insertions, 114 deletions
diff --git a/webkit/glue/plugins/plugin_constants_win.h b/webkit/glue/plugins/plugin_constants_win.h index d2a93bda..6bc2945 100644 --- a/webkit/glue/plugins/plugin_constants_win.h +++ b/webkit/glue/plugins/plugin_constants_win.h @@ -8,18 +8,6 @@ // Used by the plugins_test when testing the older WMP plugin to force the new // plugin to not get loaded. #define kUseOldWMPPluginSwitch L"use-old-wmp" -// Used for testing the ActiveX shim. By default it's off. If this flag is -// specified we will use the native ActiveX shim. -#define kNoNativeActiveXShimSwitch L"no-activex" -// Internal file name for the ActiveX shim, used as a unique identifier. -#define kActiveXShimFileName L"activex-shim" -// Internal file name for the ActiveX shim, registered as the Windows Media -// Player. Some sites walk the plugin list and look for specifically-named -// plugins, so we must oblige them with a very specific name. See -// http://codereview.chromium.org/7234 . -#define kActiveXShimFileNameForMediaPlayer \ - L"Microsoft\xAE Windows Media Player Firefox Plugin" - // The window class name for a plugin window. #define kNativeWindowClassName L"NativeWindowClass" diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc index 44f7428..69315b2 100644 --- a/webkit/glue/plugins/plugin_list.cc +++ b/webkit/glue/plugins/plugin_list.cc @@ -10,15 +10,11 @@ #include "base/time.h" #include "net/base/mime_util.h" #include "webkit/default_plugin/plugin_main.h" +#include "webkit/glue/plugins/plugin_constants_win.h" #include "webkit/glue/plugins/plugin_lib.h" #include "webkit/glue/webkit_glue.h" #include "googleurl/src/gurl.h" -#if defined(OS_WIN) -#include "webkit/activex_shim/activex_shared.h" -#include "webkit/glue/plugins/plugin_constants_win.h" -#endif - namespace NPAPI { base::LazyInstance<PluginList> g_singleton(base::LINKER_INITIALIZED); @@ -172,8 +168,6 @@ void PluginList::LoadPlugins(bool refresh) { LoadPluginsFromDir(directories_to_scan[i], &new_plugins); } - LoadInternalPlugins(&new_plugins); - if (webkit_glue::IsDefaultPluginEnabled()) LoadPlugin(FilePath(kDefaultPluginLibraryName), &new_plugins); @@ -216,7 +210,6 @@ void PluginList::LoadPlugin(const FilePath &path, } bool PluginList::FindPlugin(const std::string& mime_type, - const std::string& clsid, bool allow_wildcard, WebPluginInfo* info) { DCHECK(mime_type == StringToLowerASCII(mime_type)); @@ -225,14 +218,6 @@ bool PluginList::FindPlugin(const std::string& mime_type, AutoLock lock(lock_); for (size_t i = 0; i < plugins_.size(); ++i) { if (SupportsType(plugins_[i], mime_type, allow_wildcard)) { -#if defined(OS_WIN) - if (!clsid.empty() && plugins_[i].path.value() == kActiveXShimFileName) { - // Special handling for ActiveX shim. If ActiveX is not installed, we - // should use the default plugin to show the installation UI. - if (!activex_shim::IsActiveXInstalled(clsid)) - continue; - } -#endif *info = plugins_[i]; return true; } @@ -241,7 +226,8 @@ bool PluginList::FindPlugin(const std::string& mime_type, return false; } -bool PluginList::FindPlugin(const GURL &url, std::string* actual_mime_type, +bool PluginList::FindPlugin(const GURL &url, + std::string* actual_mime_type, WebPluginInfo* info) { LoadPlugins(false); AutoLock lock(lock_); @@ -308,19 +294,11 @@ void PluginList::GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { bool PluginList::GetPluginInfo(const GURL& url, const std::string& mime_type, - const std::string& clsid, bool allow_wildcard, WebPluginInfo* info, std::string* actual_mime_type) { - bool found = FindPlugin(mime_type, - clsid, - allow_wildcard, info); - if (!found - || (info->path.value() == kDefaultPluginLibraryName -#if defined(OS_WIN) - && clsid.empty() -#endif - )) { + bool found = FindPlugin(mime_type, allow_wildcard, info); + if (!found || (info->path.value() == kDefaultPluginLibraryName)) { WebPluginInfo info2; if (FindPlugin(url, actual_mime_type, &info2)) { found = true; diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h index d8b5662..7fc2b58 100644 --- a/webkit/glue/plugins/plugin_list.h +++ b/webkit/glue/plugins/plugin_list.h @@ -118,7 +118,6 @@ class PluginList { // plugins which support wildcard mime types (* as the mime type). bool GetPluginInfo(const GURL& url, const std::string& mime_type, - const std::string& clsid, bool allow_wildcard, WebPluginInfo* info, std::string* actual_mime_type); @@ -149,22 +148,16 @@ class PluginList { bool ShouldLoadPlugin(const WebPluginInfo& info, std::vector<WebPluginInfo>* plugins); - // Load internal plugins. - void LoadInternalPlugins(std::vector<WebPluginInfo>* plugins); - - // Find a plugin by mime type, and clsid. - // If clsid is empty, we will just find the plugin that supports mime type. - // Otherwise, if mime_type is application/x-oleobject etc that's supported by - // by our activex shim, we need to check if the specified ActiveX exists. - // If not we will not return the activex shim, instead we will let the - // default plugin handle activex installation. + // Find a plugin by mime type. // The allow_wildcard parameter controls whether this function returns // plugins which support wildcard mime types (* as the mime type) - bool FindPlugin(const std::string &mime_type, const std::string& clsid, - bool allow_wildcard, WebPluginInfo* info); + bool FindPlugin(const std::string &mime_type, + bool allow_wildcard, + WebPluginInfo* info); // Find a plugin by extension. Returns the corresponding mime type. - bool FindPlugin(const GURL &url, std::string* actual_mime_type, + bool FindPlugin(const GURL &url, + std::string* actual_mime_type, WebPluginInfo* info); // Returns true if the given WebPluginInfo supports "mime-type". @@ -199,9 +192,6 @@ class PluginList { #if defined(OS_WIN) // true if we shouldn't load the new WMP plugin. bool dont_load_new_wmp_; - - // true if we should use our internal ActiveX shim - bool use_internal_activex_shim_; #endif // diff --git a/webkit/glue/plugins/plugin_list_linux.cc b/webkit/glue/plugins/plugin_list_linux.cc index 92864b2..45ae103 100644 --- a/webkit/glue/plugins/plugin_list_linux.cc +++ b/webkit/glue/plugins/plugin_list_linux.cc @@ -172,8 +172,4 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, return true; } -void PluginList::LoadInternalPlugins(std::vector<WebPluginInfo>* plugins) { - // none for now -} - } // namespace NPAPI diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/glue/plugins/plugin_list_mac.mm index f270643..a902fbd 100644 --- a/webkit/glue/plugins/plugin_list_mac.mm +++ b/webkit/glue/plugins/plugin_list_mac.mm @@ -99,8 +99,4 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, return true; } -void PluginList::LoadInternalPlugins(std::vector<WebPluginInfo>* plugins) { - // none for now -} - } // namespace NPAPI diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc index 95ea743..b26e9ad 100644 --- a/webkit/glue/plugins/plugin_list_win.cc +++ b/webkit/glue/plugins/plugin_list_win.cc @@ -11,7 +11,6 @@ #include "base/path_service.h" #include "base/registry.h" #include "base/string_util.h" -#include "webkit/activex_shim/npp_impl.h" #include "webkit/glue/plugins/plugin_constants_win.h" #include "webkit/glue/plugins/plugin_lib.h" #include "webkit/glue/webkit_glue.h" @@ -196,31 +195,6 @@ namespace NPAPI void PluginList::PlatformInit() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); dont_load_new_wmp_ = command_line.HasSwitch(kUseOldWMPPluginSwitch); - use_internal_activex_shim_ = - !command_line.HasSwitch(kNoNativeActiveXShimSwitch); - - const PluginVersionInfo builtin_plugins[] = { - { - FilePath(kActiveXShimFileNameForMediaPlayer), - kActiveXShimFileNameForMediaPlayer, - L"Windows Media Player", - L"1, 0, 0, 1", - L"application/x-ms-wmp|application/asx|video/x-ms-asf-plugin|" - L"application/x-mplayer2|video/x-ms-asf|video/x-ms-wm|audio/x-ms-wma|" - L"audio/x-ms-wax|video/x-ms-wmv|video/x-ms-wvx|audio/mpeg|video/mpeg", - L"*|*|*|*|asf,asx,*|wm,*|wma,*|wax,*|wmv,*|wvx,*|mp2,mp3,mpa,mpeg,mpg|" - L"mpeg,mpg,m1v,mpe", - L"", - { - activex_shim::ActiveX_Shim_NP_GetEntryPoints, - activex_shim::ActiveX_Shim_NP_Initialize, - activex_shim::ActiveX_Shim_NP_Shutdown - } - }, - }; - - for (int i = 0; i < arraysize(builtin_plugins); ++i) - internal_plugins_.push_back(builtin_plugins[i]); } void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { @@ -326,38 +300,25 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, // Special WMP handling - // We will use the ActiveX shim to handle embedded WMP media. - if (use_internal_activex_shim_) { - if (filename == kNewWMPPlugin || filename == kOldWMPPlugin) + // If both the new and old WMP plugins exist, only load the new one. + if (filename == kNewWMPPlugin) { + if (dont_load_new_wmp_) return false; - } else { - // If both the new and old WMP plugins exist, only load the new one. - if (filename == kNewWMPPlugin) { - if (dont_load_new_wmp_) - return false; - for (size_t i = 0; i < plugins->size(); ++i) { - if ((*plugins)[i].path.BaseName().value() == kOldWMPPlugin) { - plugins->erase(plugins->begin() + i); - break; - } - } - } else if (filename == kOldWMPPlugin) { - for (size_t i = 0; i < plugins->size(); ++i) { - if ((*plugins)[i].path.BaseName().value() == kNewWMPPlugin) - return false; + for (size_t i = 0; i < plugins->size(); ++i) { + if ((*plugins)[i].path.BaseName().value() == kOldWMPPlugin) { + plugins->erase(plugins->begin() + i); + break; } } + } else if (filename == kOldWMPPlugin) { + for (size_t i = 0; i < plugins->size(); ++i) { + if ((*plugins)[i].path.BaseName().value() == kNewWMPPlugin) + return false; + } } return true; } -void PluginList::LoadInternalPlugins(std::vector<WebPluginInfo>* plugins) { - if (!use_internal_activex_shim_) - return; - LoadPlugin(FilePath(kActiveXShimFileName), plugins); - LoadPlugin(FilePath(kActiveXShimFileNameForMediaPlayer), plugins); -} - } // namespace NPAPI |