summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 21:33:09 +0000
committeramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 21:33:09 +0000
commitf6b1d3e64758a188d579cb4d0bb8fa011687ea21 (patch)
treeabdea2aac057598d52be177b11b11fe039e3436b
parentd3c902b2f2d157a0e40cfe4f684c3e95fc27fc80 (diff)
downloadchromium_src-f6b1d3e64758a188d579cb4d0bb8fa011687ea21.zip
chromium_src-f6b1d3e64758a188d579cb4d0bb8fa011687ea21.tar.gz
chromium_src-f6b1d3e64758a188d579cb4d0bb8fa011687ea21.tar.bz2
Add a temporary flag to enable plugins on the Mac and Linux while
leaving the default to "disabled" until they work better. Temporary, for use by people who like living on the bleeding edge. BUG=none TEST=none jam: review evan,jon: FYI Review URL: http://codereview.chromium.org/149570 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20540 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc6
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--webkit/glue/plugins/plugin_list_mac.mm7
4 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 9a7a7c00..ec00ba5 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -155,9 +155,15 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
web_prefs.web_security_enabled =
!command_line.HasSwitch(switches::kDisableWebSecurity) &&
prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled);
+#if defined(OS_WIN)
web_prefs.plugins_enabled =
!command_line.HasSwitch(switches::kDisablePlugins) &&
prefs->GetBoolean(prefs::kWebKitPluginsEnabled);
+#else
+ web_prefs.plugins_enabled =
+ command_line.HasSwitch(switches::kEnablePlugins) &&
+ prefs->GetBoolean(prefs::kWebKitPluginsEnabled);
+#endif
web_prefs.java_enabled =
!command_line.HasSwitch(switches::kDisableJava) &&
prefs->GetBoolean(prefs::kWebKitJavaEnabled);
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c38e0b1..0462705 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -359,6 +359,10 @@ const wchar_t kDisableJava[] = L"disable-java";
// Prevent plugins from running.
const wchar_t kDisablePlugins[] = L"disable-plugins";
+// Force plugins to run (for ports in progress where they are turned off by
+// default).
+const wchar_t kEnablePlugins[] = L"enable-plugins";
+
// Prevent images from loading.
const wchar_t kDisableImages[] = L"disable-images";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 3588b46..8cd241e 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -124,6 +124,7 @@ extern const wchar_t kDisablePopupBlocking[];
extern const wchar_t kDisableJavaScript[];
extern const wchar_t kDisableJava[];
extern const wchar_t kDisablePlugins[];
+extern const wchar_t kEnablePlugins[];
extern const wchar_t kDisableImages[];
extern const wchar_t kDisableWebSecurity[];
extern const wchar_t kEnableRemoteFonts[];
diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/glue/plugins/plugin_list_mac.mm
index 28cf21d..90391ec 100644
--- a/webkit/glue/plugins/plugin_list_mac.mm
+++ b/webkit/glue/plugins/plugin_list_mac.mm
@@ -68,15 +68,12 @@ void PluginList::LoadPluginsFromDir(const FilePath &path) {
}
bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) {
- // TODO(port): uncomment the next line to enable plugins--disabled by
- // default so that public dev builds fall back correctly to the no-plugin
- // code on pages with plugins.
- return false;
-
// Hierarchy check
// (we're loading plugins hierarchically from Library folders, so plugins we
// encounter earlier must override plugins we encounter later)
+ // first, test to make sure the user really wants plugins
+
for (size_t i = 0; i < plugins_.size(); ++i) {
if (plugins_[i].path.BaseName() == info.path.BaseName()) {
return false; // We already have a loaded plugin higher in the hierarchy.