OLD | NEW |
| (Empty) |
1 // Copyright 2015 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/enable_npapi_plugins_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 EnableNpapiPluginsPolicyHandler::EnableNpapiPluginsPolicyHandler() { | |
18 } | |
19 | |
20 EnableNpapiPluginsPolicyHandler::~EnableNpapiPluginsPolicyHandler() { | |
21 } | |
22 | |
23 void EnableNpapiPluginsPolicyHandler::ApplyPolicySettings( | |
24 const PolicyMap& policies, | |
25 PrefValueMap* prefs) { | |
26 const std::string plugin_policies[] = {key::kEnabledPlugins, | |
27 key::kPluginsAllowedForUrls, | |
28 key::kPluginsBlockedForUrls, | |
29 key::kDisabledPluginsExceptions, | |
30 key::kDisabledPlugins}; | |
31 | |
32 for (auto policy : plugin_policies) { | |
33 if (policies.GetValue(policy)) { | |
34 prefs->SetBoolean(prefs::kEnableNpapi, true); | |
35 break; | |
36 } | |
37 } | |
38 } | |
39 | |
40 bool EnableNpapiPluginsPolicyHandler::CheckPolicySettings( | |
41 const PolicyMap& policies, | |
42 PolicyErrorMap* prefs) { | |
43 return true; | |
44 } | |
45 | |
46 } // namespace policy | |
OLD | NEW |