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

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

Issue 6409040: New policy protobuf protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/asynchronous_policy_provider.h" 5 #include "chrome/browser/policy/asynchronous_policy_provider.h"
6 6
7 #include "chrome/browser/policy/asynchronous_policy_loader.h" 7 #include "chrome/browser/policy/asynchronous_policy_loader.h"
8 8
9 namespace policy { 9 namespace policy {
10 10
11 AsynchronousPolicyProvider::AsynchronousPolicyProvider( 11 AsynchronousPolicyProvider::AsynchronousPolicyProvider(
12 const PolicyDefinitionList* policy_list, 12 const PolicyDefinitionList* policy_list,
13 scoped_refptr<AsynchronousPolicyLoader> loader) 13 scoped_refptr<AsynchronousPolicyLoader> loader)
14 : ConfigurationPolicyProvider(policy_list), 14 : ConfigurationPolicyProvider(policy_list),
15 loader_(loader) { 15 loader_(loader) {
16 loader_->Init(); 16 loader_->Init();
17 } 17 }
18 18
19 AsynchronousPolicyProvider::~AsynchronousPolicyProvider() { 19 AsynchronousPolicyProvider::~AsynchronousPolicyProvider() {
20 DCHECK(CalledOnValidThread()); 20 DCHECK(CalledOnValidThread());
21 loader_->Stop(); 21 loader_->Stop();
22 } 22 }
23 23
24 bool AsynchronousPolicyProvider::Provide( 24 bool AsynchronousPolicyProvider::Provide(
25 ConfigurationPolicyStoreInterface* store) { 25 ConfigurationPolicyStoreInterface* store) {
26 DCHECK(CalledOnValidThread()); 26 DCHECK(CalledOnValidThread());
27 DCHECK(loader_->policy()); 27 DCHECK(loader_->policy());
28 DecodePolicyValueTree(loader_->policy(), store); 28 ApplyPolicyValueTree(loader_->policy(), store);
29 return true; 29 return true;
30 } 30 }
31 31
32 void AsynchronousPolicyProvider::AddObserver( 32 void AsynchronousPolicyProvider::AddObserver(
33 ConfigurationPolicyProvider::Observer* observer) { 33 ConfigurationPolicyProvider::Observer* observer) {
34 loader_->AddObserver(observer); 34 loader_->AddObserver(observer);
35 } 35 }
36 36
37 void AsynchronousPolicyProvider::RemoveObserver( 37 void AsynchronousPolicyProvider::RemoveObserver(
38 ConfigurationPolicyProvider::Observer* observer) { 38 ConfigurationPolicyProvider::Observer* observer) {
39 loader_->RemoveObserver(observer); 39 loader_->RemoveObserver(observer);
40 } 40 }
41 41
42 scoped_refptr<AsynchronousPolicyLoader> AsynchronousPolicyProvider::loader() { 42 scoped_refptr<AsynchronousPolicyLoader> AsynchronousPolicyProvider::loader() {
43 return loader_; 43 return loader_;
44 } 44 }
45 45
46 } // namespace policy 46 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/app/policy/syntax_check_policy_template_json.py ('k') | chrome/browser/policy/cloud_policy_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698