diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 15:38:29 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 15:38:29 +0000 |
commit | 8b86363bc6c71aed7d10bef1c496b558faac5628 (patch) | |
tree | 96a77f7782d593b380bc02332935b8c692902341 /chrome/browser/plugin_updater.cc | |
parent | c500bc9f09f9b28c9dbc2c956abdbb8e7f5e6600 (diff) | |
download | chromium_src-8b86363bc6c71aed7d10bef1c496b558faac5628.zip chromium_src-8b86363bc6c71aed7d10bef1c496b558faac5628.tar.gz chromium_src-8b86363bc6c71aed7d10bef1c496b558faac5628.tar.bz2 |
Disable outdated non-sandboxed plugins.
BUG=47731
TEST=Run with --disable-outdated-plugins
Review URL: http://codereview.chromium.org/3038051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_updater.cc')
-rw-r--r-- | chrome/browser/plugin_updater.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc index 03846aa..90a8daa 100644 --- a/chrome/browser/plugin_updater.cc +++ b/chrome/browser/plugin_updater.cc @@ -7,6 +7,7 @@ #include <string> #include <vector> +#include "base/command_line.h" #include "base/path_service.h" #include "base/scoped_ptr.h" #include "base/values.h" @@ -14,6 +15,7 @@ #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/plugin_group.h" #include "chrome/common/pref_names.h" #include "webkit/glue/plugins/plugin_list.h" @@ -207,6 +209,19 @@ void DisablePluginGroupsFromPrefs(Profile* profile) { } } +void DisableOutdatedPluginGroups() { + std::vector<linked_ptr<PluginGroup> > groups; + GetPluginGroups(&groups); + for (std::vector<linked_ptr<PluginGroup> >::iterator it = + groups.begin(); + it != groups.end(); + ++it) { + if ((*it)->IsVulnerable()) { + (*it)->Enable(false); + } + } +} + void UpdatePreferences(Profile* profile) { ListValue* plugins_list = profile->GetPrefs()->GetMutableList( prefs::kPluginsPluginsList); @@ -234,7 +249,9 @@ void UpdatePreferences(Profile* profile) { it != plugin_groups.end(); ++it) { // Don't save preferences for vulnerable pugins. - if (!(*it)->IsVulnerable()) { + if (!CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableOutdatedPlugins) || + !(*it)->IsVulnerable()) { plugins_list->Append((*it)->GetSummary()); } } |