Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: chrome/browser/policy/policy_service_impl.cc

Issue 22493010: policy: load JSON schema into domain descriptor at start time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments and clean up includes Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698