Index: chrome/browser/plugins/plugin_policy_handler.cc |
diff --git a/chrome/browser/plugins/plugin_policy_handler.cc b/chrome/browser/plugins/plugin_policy_handler.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..060782151fd9aa4cf846918301c4cd701813f084 |
--- /dev/null |
+++ b/chrome/browser/plugins/plugin_policy_handler.cc |
@@ -0,0 +1,38 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/plugins/plugin_policy_handler.h" |
+ |
+#include "base/logging.h" |
+#include "base/prefs/pref_value_map.h" |
+#include "base/values.h" |
+#include "chrome/common/pref_names.h" |
+#include "components/policy/core/browser/policy_error_map.h" |
+#include "components/policy/core/common/policy_map.h" |
+#include "policy/policy_constants.h" |
+ |
+namespace policy { |
+ |
+PluginPolicyHandler::PluginPolicyHandler( |
+ const char* policy_name, |
+ const char* pref_path, |
+ base::Value::Type value_type) |
+ : TypeCheckingPolicyHandler(policy_name, value_type), |
+ pref_path_(pref_path) { |
+} |
+ |
+PluginPolicyHandler::~PluginPolicyHandler() {} |
+ |
+void PluginPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, |
+ PrefValueMap* prefs) { |
+ if (!pref_path_) |
+ return; |
+ const base::Value* value = policies.GetValue(policy_name()); |
+ if (value) { |
+ prefs->SetBoolean(prefs::kEnableNpapi, true); |
Mattias Nissler (ping if slow)
2015/04/10 08:47:15
You have multiple instances of this policy handler
Will Harris
2015/04/10 18:51:23
Done.
|
+ prefs->SetValue(pref_path_, value->DeepCopy()); |
+ } |
+} |
+ |
+} // namespace policy |