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

Unified Diff: chrome/browser/plugins/plugin_prefs.cc

Issue 1071713004: Enable NPAPI if policy has plugin policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix GN Created 5 years, 8 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/plugins/plugin_prefs.h ('k') | chrome/browser/plugins/plugin_prefs_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_prefs.cc
diff --git a/chrome/browser/plugins/plugin_prefs.cc b/chrome/browser/plugins/plugin_prefs.cc
index 97dcf993ea7efe82fd659b7221d5a93f9726edfd..ad57001712095fa145d5296d8e832a7422919e71 100644
--- a/chrome/browser/plugins/plugin_prefs.cc
+++ b/chrome/browser/plugins/plugin_prefs.cc
@@ -280,6 +280,11 @@ void PluginPrefs::UpdatePatternsAndNotify(std::set<base::string16>* patterns,
NotifyPluginStatusChanged();
}
+void PluginPrefs::EnableNpapi() {
+ PluginService::GetInstance()->EnableNpapiPlugins();
+ NotifyPluginStatusChanged();
+}
+
/*static*/
bool PluginPrefs::IsStringMatchedInSet(
const base::string16& name,
@@ -486,6 +491,9 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
ListValueToStringSet(prefs_->GetList(prefs::kPluginsEnabledPlugins),
&policy_enabled_plugin_patterns_);
+ if (prefs_->GetBoolean(prefs::kEnableNpapi))
+ EnableNpapi();
+
registrar_.Init(prefs_);
// Because pointers to our own members will remain unchanged for the
@@ -504,6 +512,9 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
base::Bind(&PluginPrefs::UpdatePatternsAndNotify,
base::Unretained(this),
&policy_enabled_plugin_patterns_));
+ registrar_.Add(prefs::kEnableNpapi,
+ base::Bind(&PluginPrefs::EnableNpapi,
+ base::Unretained(this)));
NotifyPluginStatusChanged();
}
« no previous file with comments | « chrome/browser/plugins/plugin_prefs.h ('k') | chrome/browser/plugins/plugin_prefs_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698