| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/extensions/policy_handlers.h" | 5 #include "chrome/browser/extensions/policy_handlers.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_value_map.h" | 8 #include "base/prefs/pref_value_map.h" |
| 9 #include "chrome/browser/extensions/external_policy_loader.h" | 9 #include "chrome/browser/extensions/external_policy_loader.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 ValueTypeToString(base::Value::TYPE_STRING)); | 79 ValueTypeToString(base::Value::TYPE_STRING)); |
| 80 continue; | 80 continue; |
| 81 } | 81 } |
| 82 if (!(allow_wildcards_ && id == "*") && | 82 if (!(allow_wildcards_ && id == "*") && |
| 83 !extensions::Extension::IdIsValid(id)) { | 83 !extensions::Extension::IdIsValid(id)) { |
| 84 errors->AddError(policy_name(), | 84 errors->AddError(policy_name(), |
| 85 entry - list_value->begin(), | 85 entry - list_value->begin(), |
| 86 IDS_POLICY_VALUE_FORMAT_ERROR); | 86 IDS_POLICY_VALUE_FORMAT_ERROR); |
| 87 continue; | 87 continue; |
| 88 } | 88 } |
| 89 filtered_list->Append(base::Value::CreateStringValue(id)); | 89 filtered_list->Append(new base::StringValue(id)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 if (extension_ids) | 92 if (extension_ids) |
| 93 *extension_ids = filtered_list.Pass(); | 93 *extension_ids = filtered_list.Pass(); |
| 94 | 94 |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 // ExtensionInstallForcelistPolicyHandler implementation ----------------------- | 98 // ExtensionInstallForcelistPolicyHandler implementation ----------------------- |
| 99 | 99 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 const policy::PolicyMap& policies, | 239 const policy::PolicyMap& policies, |
| 240 PrefValueMap* prefs) { | 240 PrefValueMap* prefs) { |
| 241 if (!pref_path_) | 241 if (!pref_path_) |
| 242 return; | 242 return; |
| 243 const base::Value* value = policies.GetValue(policy_name()); | 243 const base::Value* value = policies.GetValue(policy_name()); |
| 244 if (value) | 244 if (value) |
| 245 prefs->SetValue(pref_path_, value->DeepCopy()); | 245 prefs->SetValue(pref_path_, value->DeepCopy()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace extensions | 248 } // namespace extensions |
| OLD | NEW |