| 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/policy_service_impl.h" | 5 #include "chrome/browser/policy/policy_service_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 void PolicyServiceImpl::RegisterPolicyDomain( | 65 void PolicyServiceImpl::RegisterPolicyDomain( |
| 66 scoped_refptr<const PolicyDomainDescriptor> descriptor) { | 66 scoped_refptr<const PolicyDomainDescriptor> descriptor) { |
| 67 domain_descriptors_[descriptor->domain()] = descriptor; | 67 domain_descriptors_[descriptor->domain()] = descriptor; |
| 68 for (Iterator it = providers_.begin(); it != providers_.end(); ++it) | 68 for (Iterator it = providers_.begin(); it != providers_.end(); ++it) |
| 69 (*it)->RegisterPolicyDomain(descriptor); | 69 (*it)->RegisterPolicyDomain(descriptor); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void PolicyServiceImpl::InitialRegisterPolicyDomain( |
| 73 scoped_refptr<const PolicyDomainDescriptor> descriptor) { |
| 74 domain_descriptors_[descriptor->domain()] = descriptor; |
| 75 for (Iterator it = providers_.begin(); it != providers_.end(); ++it) |
| 76 (*it)->InitialRegisterPolicyDomain(descriptor); |
| 77 } |
| 78 |
| 72 const PolicyMap& PolicyServiceImpl::GetPolicies( | 79 const PolicyMap& PolicyServiceImpl::GetPolicies( |
| 73 const PolicyNamespace& ns) const { | 80 const PolicyNamespace& ns) const { |
| 74 return policy_bundle_.Get(ns); | 81 return policy_bundle_.Get(ns); |
| 75 } | 82 } |
| 76 | 83 |
| 77 scoped_refptr<const PolicyDomainDescriptor> | 84 scoped_refptr<const PolicyDomainDescriptor> |
| 78 PolicyServiceImpl::GetPolicyDomainDescriptor(PolicyDomain domain) const { | 85 PolicyServiceImpl::GetPolicyDomainDescriptor(PolicyDomain domain) const { |
| 79 return domain_descriptors_[domain]; | 86 return domain_descriptors_[domain]; |
| 80 } | 87 } |
| 81 | 88 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 if (refresh_pending_.empty() && !refresh_callbacks_.empty()) { | 224 if (refresh_pending_.empty() && !refresh_callbacks_.empty()) { |
| 218 std::vector<base::Closure> callbacks; | 225 std::vector<base::Closure> callbacks; |
| 219 callbacks.swap(refresh_callbacks_); | 226 callbacks.swap(refresh_callbacks_); |
| 220 std::vector<base::Closure>::iterator it; | 227 std::vector<base::Closure>::iterator it; |
| 221 for (it = callbacks.begin(); it != callbacks.end(); ++it) | 228 for (it = callbacks.begin(); it != callbacks.end(); ++it) |
| 222 it->Run(); | 229 it->Run(); |
| 223 } | 230 } |
| 224 } | 231 } |
| 225 | 232 |
| 226 } // namespace policy | 233 } // namespace policy |
| OLD | NEW |