OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome/browser/policy/cloud_policy_cache_base.h" | |
11 #include "chrome/browser/policy/configuration_policy_provider.h" | 10 #include "chrome/browser/policy/configuration_policy_provider.h" |
12 | 11 |
13 namespace policy { | 12 namespace policy { |
14 | 13 |
| 14 class CloudPolicyCacheBase; |
| 15 |
15 // A policy provider having multiple backend caches, combining their relevant | 16 // A policy provider having multiple backend caches, combining their relevant |
16 // PolicyMaps and keeping the result cached. The underlying caches are kept as | 17 // PolicyMaps and keeping the result cached. The underlying caches are kept as |
17 // weak references and can be added dynamically. Also the | 18 // weak references and can be added dynamically. Also the |
18 // |CloudPolicyProvider| instance listens to cache-notifications and removes | 19 // |CloudPolicyProvider| instance listens to cache-notifications and removes |
19 // the caches automatically when they go away. The order in which the caches are | 20 // the caches automatically when they go away. The order in which the caches are |
20 // stored matters! The first cache is applied as is and the following caches | 21 // stored matters! The first cache is applied as is and the following caches |
21 // only contribute the not-yet applied policies. There are two functions to add | 22 // only contribute the not-yet applied policies. There are two functions to add |
22 // a new cache: | 23 // a new cache: |
23 // PrependCache(cache): adds |cache| to the front (i.e. most important cache). | 24 // PrependCache(cache): adds |cache| to the front (i.e. most important cache). |
24 // AppendCache(cache): adds |cache| to the back (i.e. least important cache). | 25 // AppendCache(cache): adds |cache| to the back (i.e. least important cache). |
(...skipping 13 matching lines...) Expand all Loading... |
38 // automatically remove it from |caches_|. | 39 // automatically remove it from |caches_|. |
39 virtual void PrependCache(CloudPolicyCacheBase* cache) = 0; | 40 virtual void PrependCache(CloudPolicyCacheBase* cache) = 0; |
40 | 41 |
41 private: | 42 private: |
42 DISALLOW_COPY_AND_ASSIGN(CloudPolicyProvider); | 43 DISALLOW_COPY_AND_ASSIGN(CloudPolicyProvider); |
43 }; | 44 }; |
44 | 45 |
45 } // namespace policy | 46 } // namespace policy |
46 | 47 |
47 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ | 48 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_PROVIDER_H_ |
OLD | NEW |