OLD | NEW |
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 #ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_MANAGER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_MANAGER_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/prefs/pref_member.h" | 14 #include "base/prefs/pref_member.h" |
15 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 15 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
16 #include "chrome/browser/policy/cloud/cloud_policy_core.h" | 16 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
17 #include "chrome/browser/policy/cloud/cloud_policy_store.h" | 17 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
18 #include "chrome/browser/policy/cloud/component_cloud_policy_service.h" | 18 #include "components/policy/core/common/cloud/component_cloud_policy_service.h" |
19 #include "components/policy/core/common/configuration_policy_provider.h" | 19 #include "components/policy/core/common/configuration_policy_provider.h" |
| 20 #include "components/policy/policy_export.h" |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 class FilePath; | 23 class FilePath; |
23 class SequencedTaskRunner; | 24 class SequencedTaskRunner; |
24 } | 25 } |
25 | 26 |
26 namespace net { | 27 namespace net { |
27 class URLRequestContextGetter; | 28 class URLRequestContextGetter; |
28 } | 29 } |
29 | 30 |
30 namespace policy { | 31 namespace policy { |
31 | 32 |
32 // CloudPolicyManager is the main switching central between cloud policy and the | 33 // CloudPolicyManager is the main switching central between cloud policy and the |
33 // upper layers of the policy stack. It wires up a CloudPolicyCore to the | 34 // upper layers of the policy stack. It wires up a CloudPolicyCore to the |
34 // ConfigurationPolicyProvider interface. | 35 // ConfigurationPolicyProvider interface. |
35 // | 36 // |
36 // This class contains the base functionality, there are subclasses that add | 37 // This class contains the base functionality, there are subclasses that add |
37 // functionality specific to user-level and device-level cloud policy, such as | 38 // functionality specific to user-level and device-level cloud policy, such as |
38 // blocking on initial user policy fetch or device enrollment. | 39 // blocking on initial user policy fetch or device enrollment. |
39 class CloudPolicyManager : public ConfigurationPolicyProvider, | 40 class POLICY_EXPORT CloudPolicyManager |
40 public CloudPolicyStore::Observer, | 41 : public ConfigurationPolicyProvider, |
41 public ComponentCloudPolicyService::Delegate { | 42 public CloudPolicyStore::Observer, |
| 43 public ComponentCloudPolicyService::Delegate { |
42 public: | 44 public: |
43 // |task_runner| is the runner for policy refresh tasks. | 45 // |task_runner| is the runner for policy refresh tasks. |
44 // |file_task_runner| is used for file operations. Currently this must be the | 46 // |file_task_runner| is used for file operations. Currently this must be the |
45 // FILE BrowserThread. | 47 // FILE BrowserThread. |
46 // |io_task_runner| is used for network IO. Currently this must be the IO | 48 // |io_task_runner| is used for network IO. Currently this must be the IO |
47 // BrowserThread. | 49 // BrowserThread. |
48 CloudPolicyManager( | 50 CloudPolicyManager( |
49 const PolicyNamespaceKey& policy_ns_key, | 51 const PolicyNamespaceKey& policy_ns_key, |
50 CloudPolicyStore* cloud_policy_store, | 52 CloudPolicyStore* cloud_policy_store, |
51 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 53 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool waiting_for_policy_refresh_; | 104 bool waiting_for_policy_refresh_; |
103 | 105 |
104 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | 106 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
105 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; | 107 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; |
106 | 108 |
107 DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager); | 109 DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager); |
108 }; | 110 }; |
109 | 111 |
110 } // namespace policy | 112 } // namespace policy |
111 | 113 |
112 #endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_MANAGER_H_ | 114 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ |
OLD | NEW |