OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ | |
6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ | |
7 #pragma once | |
8 | |
Mattias Nissler (ping if slow)
2011/06/21 20:09:56
#include "base/basictypes.h" for DISALLOW_COPY_AND
gfeher
2011/06/22 19:18:34
Done.
| |
9 #include "chrome/browser/policy/cloud_policy_cache_base.h" | |
10 #include "chrome/browser/policy/configuration_policy_provider.h" | |
11 | |
12 namespace policy { | |
13 | |
14 // A policy provider having multiple backend caches, combining their relevant | |
15 // PolicyMaps and keeping the result cached. The underlying caches are kept as | |
16 // weak references and can be added dynamically. Also the | |
17 // |CloudPolicyProvider| instance listens to cache-notifications and removes | |
18 // the caches automatically when they go away. The order in which the caches are | |
19 // stored matters! The first cache is applied as is and the following caches | |
20 // only contribute the not-yet applied policies. There are two functions to add | |
21 // a new cache: | |
22 // PrependCache(cache): adds |cache| to the front (i.e. most important cache). | |
23 // AppendCache(cache): adds |cache| to the back (i.e. least important cache). | |
24 class CloudPolicyProvider : public ConfigurationPolicyProvider { | |
25 public: | |
26 explicit CloudPolicyProvider( | |
27 const ConfigurationPolicyProvider::PolicyDefinitionList* policy_list); | |
28 virtual ~CloudPolicyProvider(); | |
29 | |
30 // Adds a new instance of CloudPolicyCacheBase to the end of |caches_|. | |
31 // Does not take ownership of |cache| and listens to OnCacheGoingAway to | |
32 // automatically remove it from |caches_|. | |
33 virtual void AppendCache(CloudPolicyCacheBase* cache) = 0; | |
34 | |
35 // Adds a new instance of CloudPolicyCacheBase to the beginning of |caches_|. | |
36 // Does not take ownership of |cache| and listens to OnCacheGoingAway to | |
37 // automatically remove it from |caches_|. | |
38 virtual void PrependCache(CloudPolicyCacheBase* cache) = 0; | |
39 | |
40 private: | |
41 DISALLOW_COPY_AND_ASSIGN(CloudPolicyProvider); | |
42 }; | |
43 | |
44 } // namespace policy | |
45 | |
46 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ | |
OLD | NEW |