| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/plugins/plugin_policy_handler.h" | 5 #include "chrome/browser/plugins/plugin_policy_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/pattern.h" | 10 #include "base/strings/pattern.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool PluginPolicyHandler::CheckPolicySettings(const policy::PolicyMap& policies, | 73 bool PluginPolicyHandler::CheckPolicySettings(const policy::PolicyMap& policies, |
| 74 policy::PolicyErrorMap* errors) { | 74 policy::PolicyErrorMap* errors) { |
| 75 const std::string checked_policies[] = { | 75 const std::string checked_policies[] = { |
| 76 policy::key::kEnabledPlugins, policy::key::kDisabledPlugins, | 76 policy::key::kEnabledPlugins, policy::key::kDisabledPlugins, |
| 77 policy::key::kDisabledPluginsExceptions}; | 77 policy::key::kDisabledPluginsExceptions}; |
| 78 bool ok = true; | 78 bool ok = true; |
| 79 for (size_t i = 0; i < arraysize(checked_policies); ++i) { | 79 for (size_t i = 0; i < arraysize(checked_policies); ++i) { |
| 80 const base::Value* value = policies.GetValue(checked_policies[i]); | 80 const base::Value* value = policies.GetValue(checked_policies[i]); |
| 81 if (value && !value->IsType(base::Value::TYPE_LIST)) { | 81 if (value && !value->IsType(base::Value::Type::LIST)) { |
| 82 errors->AddError(checked_policies[i], IDS_POLICY_TYPE_ERROR, | 82 errors->AddError(checked_policies[i], IDS_POLICY_TYPE_ERROR, |
| 83 base::Value::GetTypeName(base::Value::TYPE_LIST)); | 83 base::Value::GetTypeName(base::Value::Type::LIST)); |
| 84 ok = false; | 84 ok = false; |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 return ok; | 87 return ok; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void PluginPolicyHandler::ApplyPolicySettings(const policy::PolicyMap& policies, | 90 void PluginPolicyHandler::ApplyPolicySettings(const policy::PolicyMap& policies, |
| 91 PrefValueMap* prefs) { | 91 PrefValueMap* prefs) { |
| 92 // This order makes enabled plugins take precedence as is now. | 92 // This order makes enabled plugins take precedence as is now. |
| 93 ProcessPolicy(policies, prefs, policy::key::kDisabledPlugins, true, | 93 ProcessPolicy(policies, prefs, policy::key::kDisabledPlugins, true, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 111 prefs->RemoveValue(prefs::kPluginsAlwaysOpenPdfExternally); | 111 prefs->RemoveValue(prefs::kPluginsAlwaysOpenPdfExternally); |
| 112 } | 112 } |
| 113 if ((base::MatchPattern( | 113 if ((base::MatchPattern( |
| 114 PluginMetadata::kAdobeFlashPlayerGroupName, plugin) || | 114 PluginMetadata::kAdobeFlashPlayerGroupName, plugin) || |
| 115 base::MatchPattern(content::kFlashPluginName, plugin)) && | 115 base::MatchPattern(content::kFlashPluginName, plugin)) && |
| 116 !policies.GetValue(policy::key::kDefaultPluginsSetting)) { | 116 !policies.GetValue(policy::key::kDefaultPluginsSetting)) { |
| 117 prefs->RemoveValue(prefs::kManagedDefaultPluginsSetting); | 117 prefs->RemoveValue(prefs::kManagedDefaultPluginsSetting); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 } | 120 } |
| OLD | NEW |