OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_COMPONENT_CLOUD_POLICY_SERVICE_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
14 #include "chrome/browser/policy/cloud/cloud_policy_client.h" | 14 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
15 #include "chrome/browser/policy/cloud/cloud_policy_core.h" | 15 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
16 #include "chrome/browser/policy/cloud/cloud_policy_store.h" | 16 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
17 #include "components/policy/core/common/policy_bundle.h" | 17 #include "components/policy/core/common/policy_bundle.h" |
18 #include "components/policy/core/common/policy_namespace.h" | 18 #include "components/policy/core/common/policy_namespace.h" |
19 #include "components/policy/core/common/schema_registry.h" | 19 #include "components/policy/core/common/schema_registry.h" |
| 20 #include "components/policy/policy_export.h" |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 class SequencedTaskRunner; | 23 class SequencedTaskRunner; |
23 } | 24 } |
24 | 25 |
25 namespace net { | 26 namespace net { |
26 class URLRequestContextGetter; | 27 class URLRequestContextGetter; |
27 } | 28 } |
28 | 29 |
29 namespace policy { | 30 namespace policy { |
30 | 31 |
31 class ExternalPolicyDataFetcherBackend; | 32 class ExternalPolicyDataFetcherBackend; |
32 class ResourceCache; | 33 class ResourceCache; |
33 class SchemaMap; | 34 class SchemaMap; |
34 | 35 |
35 // Manages cloud policy for components. | 36 // Manages cloud policy for components. |
36 // | 37 // |
37 // This class takes care of fetching, validating, storing and updating policy | 38 // This class takes care of fetching, validating, storing and updating policy |
38 // for components. The components to manage come from a SchemaRegistry. | 39 // for components. The components to manage come from a SchemaRegistry. |
39 class ComponentCloudPolicyService : public CloudPolicyClient::Observer, | 40 class POLICY_EXPORT ComponentCloudPolicyService |
40 public CloudPolicyCore::Observer, | 41 : public CloudPolicyClient::Observer, |
41 public CloudPolicyStore::Observer, | 42 public CloudPolicyCore::Observer, |
42 public SchemaRegistry::Observer, | 43 public CloudPolicyStore::Observer, |
43 public base::NonThreadSafe { | 44 public SchemaRegistry::Observer, |
| 45 public base::NonThreadSafe { |
44 public: | 46 public: |
45 class Delegate { | 47 class POLICY_EXPORT Delegate { |
46 public: | 48 public: |
47 virtual ~Delegate(); | 49 virtual ~Delegate(); |
48 | 50 |
49 // Invoked whenever the policy served by policy() changes. This is also | 51 // Invoked whenever the policy served by policy() changes. This is also |
50 // invoked for the first time once the backend is initialized, and | 52 // invoked for the first time once the backend is initialized, and |
51 // is_initialized() becomes true. | 53 // is_initialized() becomes true. |
52 virtual void OnComponentCloudPolicyUpdated() = 0; | 54 virtual void OnComponentCloudPolicyUpdated() = 0; |
53 }; | 55 }; |
54 | 56 |
55 // The |delegate| is notified of updates to the downloaded policies and must | 57 // The |delegate| is notified of updates to the downloaded policies and must |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // user signs in again. | 169 // user signs in again. |
168 bool is_registered_for_cloud_policy_; | 170 bool is_registered_for_cloud_policy_; |
169 | 171 |
170 base::WeakPtrFactory<ComponentCloudPolicyService> weak_ptr_factory_; | 172 base::WeakPtrFactory<ComponentCloudPolicyService> weak_ptr_factory_; |
171 | 173 |
172 DISALLOW_COPY_AND_ASSIGN(ComponentCloudPolicyService); | 174 DISALLOW_COPY_AND_ASSIGN(ComponentCloudPolicyService); |
173 }; | 175 }; |
174 | 176 |
175 } // namespace policy | 177 } // namespace policy |
176 | 178 |
177 #endif // CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_ | 179 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_COMPONENT_CLOUD_POLICY_SERVICE_H_ |
OLD | NEW |