| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 IDS_POLICY_TYPE_ERROR, | 84 IDS_POLICY_TYPE_ERROR, |
| 85 ValueTypeToString(base::Value::TYPE_STRING)); | 85 ValueTypeToString(base::Value::TYPE_STRING)); |
| 86 continue; | 86 continue; |
| 87 } | 87 } |
| 88 if (!(allow_wildcards_ && id == "*") && !crx_file::id_util::IdIsValid(id)) { | 88 if (!(allow_wildcards_ && id == "*") && !crx_file::id_util::IdIsValid(id)) { |
| 89 errors->AddError(policy_name(), | 89 errors->AddError(policy_name(), |
| 90 entry - list_value->begin(), | 90 entry - list_value->begin(), |
| 91 IDS_POLICY_VALUE_FORMAT_ERROR); | 91 IDS_POLICY_VALUE_FORMAT_ERROR); |
| 92 continue; | 92 continue; |
| 93 } | 93 } |
| 94 filtered_list->Append(new base::StringValue(id)); | 94 filtered_list->AppendString(id); |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (extension_ids) | 97 if (extension_ids) |
| 98 *extension_ids = std::move(filtered_list); | 98 *extension_ids = std::move(filtered_list); |
| 99 | 99 |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 // ExtensionInstallForcelistPolicyHandler implementation ----------------------- | 103 // ExtensionInstallForcelistPolicyHandler implementation ----------------------- |
| 104 | 104 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void ExtensionSettingsPolicyHandler::ApplyPolicySettings( | 320 void ExtensionSettingsPolicyHandler::ApplyPolicySettings( |
| 321 const policy::PolicyMap& policies, | 321 const policy::PolicyMap& policies, |
| 322 PrefValueMap* prefs) { | 322 PrefValueMap* prefs) { |
| 323 std::unique_ptr<base::Value> policy_value; | 323 std::unique_ptr<base::Value> policy_value; |
| 324 if (!CheckAndGetValue(policies, NULL, &policy_value) || !policy_value) | 324 if (!CheckAndGetValue(policies, NULL, &policy_value) || !policy_value) |
| 325 return; | 325 return; |
| 326 prefs->SetValue(pref_names::kExtensionManagement, std::move(policy_value)); | 326 prefs->SetValue(pref_names::kExtensionManagement, std::move(policy_value)); |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace extensions | 329 } // namespace extensions |
| OLD | NEW |