Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: chrome/browser/plugin_updater.cc

Issue 2967007: Disable outdated plugins, block non-sandboxed plugins. (Closed)
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugin_updater.h ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_updater.cc
diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc
index 0691bac6ece6cdac4d4c1e5da6b9cf458f8f8065..cb0fe670004c6caf86086c42ff58d8ffe2365852 100644
--- a/chrome/browser/plugin_updater.cc
+++ b/chrome/browser/plugin_updater.cc
@@ -7,12 +7,14 @@
#include <string>
#include <vector>
+#include "base/command_line.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/values.h"
#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"
@@ -206,6 +208,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);
@@ -233,7 +248,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());
}
}
« no previous file with comments | « chrome/browser/plugin_updater.h ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698