From 907786e0ea57fa7bb02c6ea131b851610dd35d66 Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Mon, 5 Oct 2009 05:00:57 -0400 Subject: [PATCH] Bug 189378: add pref to disable plugins in the browser, r=josh --HG-- extra : rebase_source : 7f70e2585d6b2840fa801969e5af50c5e81caca8 --- modules/plugin/base/src/nsPluginHost.cpp | 8 ++++++++ modules/plugin/base/src/nsPluginHost.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/modules/plugin/base/src/nsPluginHost.cpp b/modules/plugin/base/src/nsPluginHost.cpp index b2cd3667dc6..bef9e8e9c58 100644 --- a/modules/plugin/base/src/nsPluginHost.cpp +++ b/modules/plugin/base/src/nsPluginHost.cpp @@ -1708,6 +1708,11 @@ nsPluginHost::nsPluginHost() mDefaultPluginDisabled = tmp; } + rv = mPrefService->GetBoolPref("plugin.disable", &tmp); + if (NS_SUCCEEDED(rv)) { + mPluginsDisabled = tmp; + } + #ifdef WINCE mDefaultPluginDisabled = PR_TRUE; #endif @@ -3694,6 +3699,9 @@ NS_IMETHODIMP nsPluginHost::LoadPlugins() if (mPluginsLoaded) return NS_OK; + if (mPluginsDisabled) + return NS_OK; + PRBool pluginschanged; nsresult rv = FindPlugins(PR_TRUE, &pluginschanged); if (NS_FAILED(rv)) diff --git a/modules/plugin/base/src/nsPluginHost.h b/modules/plugin/base/src/nsPluginHost.h index 11bae40719e..3ff4ababc92 100644 --- a/modules/plugin/base/src/nsPluginHost.h +++ b/modules/plugin/base/src/nsPluginHost.h @@ -259,6 +259,9 @@ private: // set by pref plugin.default_plugin_disabled PRPackedBool mDefaultPluginDisabled; + // set by pref plugin.disable + PRPackedBool mPluginsDisabled; + nsPluginInstanceTagList mPluginInstanceTagList; nsTArray mUnusedLibraries;