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

Side by Side Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc

Issue 15061007: Added a PolicyDomainDescriptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments, rebase on new PolicySchema Created 7 years, 7 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 | Annotate | Revision Log
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/chromeos/policy/user_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (domain == POLICY_DOMAIN_CHROME) 95 if (domain == POLICY_DOMAIN_CHROME)
96 return !wait_for_policy_fetch_; 96 return !wait_for_policy_fetch_;
97 if (ComponentCloudPolicyService::SupportsDomain(domain) && 97 if (ComponentCloudPolicyService::SupportsDomain(domain) &&
98 component_policy_service_) { 98 component_policy_service_) {
99 return component_policy_service_->is_initialized(); 99 return component_policy_service_->is_initialized();
100 } 100 }
101 return true; 101 return true;
102 } 102 }
103 103
104 void UserCloudPolicyManagerChromeOS::RegisterPolicyDomain( 104 void UserCloudPolicyManagerChromeOS::RegisterPolicyDomain(
105 PolicyDomain domain, 105 scoped_refptr<const PolicyDomainDescriptor> descriptor) {
106 const std::set<std::string>& component_ids) { 106 if (ComponentCloudPolicyService::SupportsDomain(descriptor->domain()) &&
107 if (ComponentCloudPolicyService::SupportsDomain(domain) &&
108 component_policy_service_) { 107 component_policy_service_) {
109 component_policy_service_->RegisterPolicyDomain(domain, component_ids); 108 component_policy_service_->RegisterPolicyDomain(descriptor);
110 } 109 }
111 } 110 }
112 111
113 scoped_ptr<PolicyBundle> UserCloudPolicyManagerChromeOS::CreatePolicyBundle() { 112 scoped_ptr<PolicyBundle> UserCloudPolicyManagerChromeOS::CreatePolicyBundle() {
114 scoped_ptr<PolicyBundle> bundle = CloudPolicyManager::CreatePolicyBundle(); 113 scoped_ptr<PolicyBundle> bundle = CloudPolicyManager::CreatePolicyBundle();
115 if (component_policy_service_) 114 if (component_policy_service_)
116 bundle->MergeFrom(component_policy_service_->policy()); 115 bundle->MergeFrom(component_policy_service_->policy());
117 return bundle.Pass(); 116 return bundle.Pass();
118 } 117 }
119 118
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // start the scheduler. The |component_policy_service_| will call back into 268 // start the scheduler. The |component_policy_service_| will call back into
270 // OnComponentCloudPolicyUpdated() once it's ready. 269 // OnComponentCloudPolicyUpdated() once it's ready.
271 return; 270 return;
272 } 271 }
273 272
274 core()->StartRefreshScheduler(); 273 core()->StartRefreshScheduler();
275 core()->TrackRefreshDelayPref(local_state_, prefs::kUserPolicyRefreshRate); 274 core()->TrackRefreshDelayPref(local_state_, prefs::kUserPolicyRefreshRate);
276 } 275 }
277 276
278 } // namespace policy 277 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698