| 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/policy/configuration_policy_handler.h" | 5 #include "chrome/browser/policy/configuration_policy_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 for (base::ListValue::const_iterator entry(list_value->begin()); | 258 for (base::ListValue::const_iterator entry(list_value->begin()); |
| 259 entry != list_value->end(); ++entry) { | 259 entry != list_value->end(); ++entry) { |
| 260 std::string id; | 260 std::string id; |
| 261 if (!(*entry)->GetAsString(&id)) { | 261 if (!(*entry)->GetAsString(&id)) { |
| 262 errors->AddError(policy_name(), | 262 errors->AddError(policy_name(), |
| 263 entry - list_value->begin(), | 263 entry - list_value->begin(), |
| 264 IDS_POLICY_TYPE_ERROR, | 264 IDS_POLICY_TYPE_ERROR, |
| 265 ValueTypeToString(base::Value::TYPE_STRING)); | 265 ValueTypeToString(base::Value::TYPE_STRING)); |
| 266 return false; | 266 return false; |
| 267 } | 267 } |
| 268 if (!(allow_wildcards_ && id == "*") && !Extension::IdIsValid(id)) { | 268 if (!(allow_wildcards_ && id == "*") && |
| 269 !extensions::Extension::IdIsValid(id)) { |
| 269 errors->AddError(policy_name(), | 270 errors->AddError(policy_name(), |
| 270 entry - list_value->begin(), | 271 entry - list_value->begin(), |
| 271 IDS_POLICY_VALUE_FORMAT_ERROR); | 272 IDS_POLICY_VALUE_FORMAT_ERROR); |
| 272 return false; | 273 return false; |
| 273 } | 274 } |
| 274 } | 275 } |
| 275 | 276 |
| 276 if (extension_ids) | 277 if (extension_ids) |
| 277 *extension_ids = list_value; | 278 *extension_ids = list_value; |
| 278 | 279 |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 errors->AddError(policy_name(), | 1146 errors->AddError(policy_name(), |
| 1146 IDS_POLICY_OUT_OF_RANGE_ERROR, | 1147 IDS_POLICY_OUT_OF_RANGE_ERROR, |
| 1147 base::IntToString(restore_value)); | 1148 base::IntToString(restore_value)); |
| 1148 } | 1149 } |
| 1149 } | 1150 } |
| 1150 } | 1151 } |
| 1151 return true; | 1152 return true; |
| 1152 } | 1153 } |
| 1153 | 1154 |
| 1154 } // namespace policy | 1155 } // namespace policy |
| OLD | NEW |