Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_reader.h" | 5 #include "chrome/browser/policy/configuration_policy_reader.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 void ConfigurationPolicyStatusKeeper::GetPoliciesFromProvider( | 72 void ConfigurationPolicyStatusKeeper::GetPoliciesFromProvider( |
| 73 ConfigurationPolicyProvider* provider) { | 73 ConfigurationPolicyProvider* provider) { |
| 74 PolicyMap policies; | 74 PolicyMap policies; |
| 75 if (!provider->Provide(&policies)) | 75 if (!provider->Provide(&policies)) |
| 76 DLOG(WARNING) << "Failed to get policy from provider."; | 76 DLOG(WARNING) << "Failed to get policy from provider."; |
| 77 | 77 |
| 78 PolicyErrorMap errors; | 78 PolicyErrorMap errors; |
| 79 const ConfigurationPolicyHandlerList* handler_list = | 79 const ConfigurationPolicyHandlerList* handler_list = |
| 80 g_browser_process->browser_policy_connector()->GetHandlerList(); | 80 g_browser_process->browser_policy_connector()->GetHandlerList(); |
| 81 handler_list->ApplyPolicySettings(policies, NULL, &errors); | 81 handler_list->ApplyPolicySettings(policies, NULL, &errors); |
| 82 handler_list->PrepareForDisplaying(&policies); | |
|
Joao da Silva
2011/11/11 16:20:54
How was this missing :-)
| |
| 82 | 83 |
| 83 PolicyMap::const_iterator policy = policies.begin(); | 84 PolicyMap::const_iterator policy = policies.begin(); |
| 84 for ( ; policy != policies.end(); ++policy) { | 85 for ( ; policy != policies.end(); ++policy) { |
| 85 string16 name = ASCIIToUTF16(GetPolicyName(policy->first)); | 86 string16 name = ASCIIToUTF16(GetPolicyName(policy->first)); |
| 86 string16 error_message = errors.GetErrors(policy->first); | 87 string16 error_message = errors.GetErrors(policy->first); |
| 87 PolicyStatusInfo::PolicyStatus status = | 88 PolicyStatusInfo::PolicyStatus status = |
| 88 error_message.empty() ? PolicyStatusInfo::ENFORCED | 89 error_message.empty() ? PolicyStatusInfo::ENFORCED |
| 89 : PolicyStatusInfo::FAILED; | 90 : PolicyStatusInfo::FAILED; |
| 90 // TODO(joaodasilva): determine whether this is a user or device policy. | 91 // TODO(joaodasilva): determine whether this is a user or device policy. |
| 91 // http://crbug.com/102114 | 92 // http://crbug.com/102114 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 list->Append(mc_policy); | 270 list->Append(mc_policy); |
| 270 if (rp_policy) | 271 if (rp_policy) |
| 271 list->Append(rp_policy); | 272 list->Append(rp_policy); |
| 272 if (rc_policy) | 273 if (rc_policy) |
| 273 list->Append(rc_policy); | 274 list->Append(rc_policy); |
| 274 | 275 |
| 275 return added_policy; | 276 return added_policy; |
| 276 } | 277 } |
| 277 | 278 |
| 278 } // namespace policy | 279 } // namespace policy |
| OLD | NEW |