diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 17:23:18 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 17:23:18 +0000 |
commit | 0f71843bc4772a7074536f10db5d505dd7c6a50e (patch) | |
tree | 73ea31dda6a3b4fb01d7754e2af52065939f3d34 /webkit | |
parent | 8faa5a1c0c37564198f3cfd1b65c6635c3062fb6 (diff) | |
download | chromium_src-0f71843bc4772a7074536f10db5d505dd7c6a50e.zip chromium_src-0f71843bc4772a7074536f10db5d505dd7c6a50e.tar.gz chromium_src-0f71843bc4772a7074536f10db5d505dd7c6a50e.tar.bz2 |
linux: obey standard system paths for plugins
This logic comes from carefully reading what Mozilla does.
We're still behind the flag --enable-plugins so this won't
turn on plugins for users anymore.
BUG=15504
Review URL: http://codereview.chromium.org/155594
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20963 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/plugin_list_linux.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/webkit/glue/plugins/plugin_list_linux.cc b/webkit/glue/plugins/plugin_list_linux.cc index 89d94fa..e9e6e97 100644 --- a/webkit/glue/plugins/plugin_list_linux.cc +++ b/webkit/glue/plugins/plugin_list_linux.cc @@ -15,12 +15,29 @@ void PluginList::PlatformInit() { } void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { - // For now, just look in the plugins/ under the exe directory. - // TODO(port): this is not correct. Rather than getting halfway there, - // this is a one-off and its replacement should follow Firefox exactly. + // Mozilla code to reference: + // http://mxr.mozilla.org/firefox/ident?i=NS_APP_PLUGINS_DIR_LIST + // and tens of accompanying files (mxr is very helpful). + // This code carefully matches their behavior for compat reasons. + + // 1) MOZ_PLUGIN_PATH env variable. + const char* moz_plugin_path = getenv("MOZ_PLUGIN_PATH"); + if (moz_plugin_path) + plugin_dirs->push_back(FilePath(moz_plugin_path)); + + // 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins. + // TODO(evanm): should we do anything here? + + // 3) NS_APP_PLUGINS_DIR: the binary dir + "plugins/". FilePath dir; PathService::Get(base::DIR_EXE, &dir); plugin_dirs->push_back(dir.Append("plugins")); + + // 4) NS_SYSTEM_PLUGINS_DIR: + // TODO(evanm): when we support 64-bit platforms, we'll need to fix this + // to be conditional. + COMPILE_ASSERT(sizeof(int)==4, fix_system_lib_path); + plugin_dirs->push_back(FilePath("/usr/lib/mozilla/plugins")); } void PluginList::LoadPluginsFromDir(const FilePath& path) { |