Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/plugins/plugin_policy_handler.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "base/prefs/pref_value_map.h" | |
| 9 #include "base/values.h" | |
| 10 #include "chrome/common/pref_names.h" | |
| 11 #include "components/policy/core/browser/policy_error_map.h" | |
| 12 #include "components/policy/core/common/policy_map.h" | |
| 13 #include "policy/policy_constants.h" | |
| 14 | |
| 15 namespace policy { | |
| 16 | |
| 17 PluginPolicyHandler::PluginPolicyHandler( | |
| 18 const char* policy_name, | |
| 19 const char* pref_path, | |
| 20 base::Value::Type value_type) | |
| 21 : TypeCheckingPolicyHandler(policy_name, value_type), | |
| 22 pref_path_(pref_path) { | |
| 23 } | |
| 24 | |
| 25 PluginPolicyHandler::~PluginPolicyHandler() {} | |
| 26 | |
| 27 void PluginPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, | |
| 28 PrefValueMap* prefs) { | |
| 29 if (!pref_path_) | |
| 30 return; | |
| 31 const base::Value* value = policies.GetValue(policy_name()); | |
| 32 if (value) { | |
| 33 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.
| |
| 34 prefs->SetValue(pref_path_, value->DeepCopy()); | |
| 35 } | |
| 36 } | |
| 37 | |
| 38 } // namespace policy | |
| OLD | NEW |