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 "components/policy/core/browser/configuration_policy_handler.h" | 5 #include "components/policy/core/browser/configuration_policy_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 PolicyErrorMap* errors, | 339 PolicyErrorMap* errors, |
340 scoped_ptr<base::Value>* output) { | 340 scoped_ptr<base::Value>* output) { |
341 const base::Value* value = policies.GetValue(policy_name()); | 341 const base::Value* value = policies.GetValue(policy_name()); |
342 if (!value) | 342 if (!value) |
343 return true; | 343 return true; |
344 | 344 |
345 output->reset(value->DeepCopy()); | 345 output->reset(value->DeepCopy()); |
346 std::string error_path; | 346 std::string error_path; |
347 std::string error; | 347 std::string error; |
348 bool result = | 348 bool result = |
349 schema_.Normalize(output->get(), strategy_, &error_path, &error); | 349 schema_.Normalize(output->get(), strategy_, &error_path, &error, NULL); |
350 | 350 |
351 if (errors && !error.empty()) { | 351 if (errors && !error.empty()) { |
352 if (error_path.empty()) | 352 if (error_path.empty()) |
353 error_path = "(ROOT)"; | 353 error_path = "(ROOT)"; |
354 errors->AddError(policy_name_, error_path, error); | 354 errors->AddError(policy_name_, error_path, error); |
355 } | 355 } |
356 | 356 |
357 return result; | 357 return result; |
358 } | 358 } |
359 | 359 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 for (handler = legacy_policy_handlers_.begin(); | 408 for (handler = legacy_policy_handlers_.begin(); |
409 handler != legacy_policy_handlers_.end(); | 409 handler != legacy_policy_handlers_.end(); |
410 ++handler) { | 410 ++handler) { |
411 if ((*handler)->CheckPolicySettings(policies, &scoped_errors)) | 411 if ((*handler)->CheckPolicySettings(policies, &scoped_errors)) |
412 (*handler)->ApplyPolicySettings(policies, prefs); | 412 (*handler)->ApplyPolicySettings(policies, prefs); |
413 } | 413 } |
414 } | 414 } |
415 } | 415 } |
416 | 416 |
417 } // namespace policy | 417 } // namespace policy |
OLD | NEW |