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_USER_CLOUD_POLICY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_USER_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/files/file_path.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/policy/cloud/cloud_policy_manager.h" | 15 #include "chrome/browser/policy/cloud/cloud_policy_manager.h" |
15 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 16 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
16 | 17 |
17 class PrefService; | 18 class PrefService; |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class SequencedTaskRunner; | 21 class SequencedTaskRunner; |
21 } | 22 } |
(...skipping 11 matching lines...) Expand all Loading... |
33 class CloudExternalDataManager; | 34 class CloudExternalDataManager; |
34 class DeviceManagementService; | 35 class DeviceManagementService; |
35 class UserCloudPolicyStore; | 36 class UserCloudPolicyStore; |
36 | 37 |
37 // UserCloudPolicyManager handles initialization of user policy for Chrome | 38 // UserCloudPolicyManager handles initialization of user policy for Chrome |
38 // Profiles on the desktop platforms. | 39 // Profiles on the desktop platforms. |
39 class UserCloudPolicyManager : public CloudPolicyManager, | 40 class UserCloudPolicyManager : public CloudPolicyManager, |
40 public BrowserContextKeyedService { | 41 public BrowserContextKeyedService { |
41 public: | 42 public: |
42 // |task_runner| is the runner for policy refresh tasks. | 43 // |task_runner| is the runner for policy refresh tasks. |
| 44 // |file_task_runner| is used for file operations. Currently this must be |
| 45 // the FILE BrowserThread. |
| 46 // |io_task_runner| is used for network IO. Currently this must be the IO |
| 47 // BrowserThread. |
43 UserCloudPolicyManager( | 48 UserCloudPolicyManager( |
44 content::BrowserContext* context, | 49 content::BrowserContext* context, |
45 scoped_ptr<UserCloudPolicyStore> store, | 50 scoped_ptr<UserCloudPolicyStore> store, |
| 51 const base::FilePath& component_policy_cache_path, |
46 scoped_ptr<CloudExternalDataManager> external_data_manager, | 52 scoped_ptr<CloudExternalDataManager> external_data_manager, |
47 const scoped_refptr<base::SequencedTaskRunner>& task_runner); | 53 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
| 54 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, |
| 55 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); |
48 virtual ~UserCloudPolicyManager(); | 56 virtual ~UserCloudPolicyManager(); |
49 | 57 |
50 virtual void Shutdown() OVERRIDE; | 58 virtual void Shutdown() OVERRIDE; |
51 | 59 |
52 void SetSigninUsername(const std::string& username); | 60 void SetSigninUsername(const std::string& username); |
53 | 61 |
54 // Initializes the cloud connection. |local_state| must stay valid until this | 62 // Initializes the cloud connection. |local_state| must stay valid until this |
55 // object is deleted or DisconnectAndRemovePolicy() gets called. Virtual for | 63 // object is deleted or DisconnectAndRemovePolicy() gets called. Virtual for |
56 // mocking. | 64 // mocking. |
57 virtual void Connect( | 65 virtual void Connect( |
(...skipping 18 matching lines...) Expand all Loading... |
76 DeviceManagementService* device_management_service); | 84 DeviceManagementService* device_management_service); |
77 | 85 |
78 private: | 86 private: |
79 // The context this instance belongs to. | 87 // The context this instance belongs to. |
80 content::BrowserContext* context_; | 88 content::BrowserContext* context_; |
81 | 89 |
82 // Typed pointer to the store owned by UserCloudPolicyManager. Note that | 90 // Typed pointer to the store owned by UserCloudPolicyManager. Note that |
83 // CloudPolicyManager only keeps a plain CloudPolicyStore pointer. | 91 // CloudPolicyManager only keeps a plain CloudPolicyStore pointer. |
84 scoped_ptr<UserCloudPolicyStore> store_; | 92 scoped_ptr<UserCloudPolicyStore> store_; |
85 | 93 |
| 94 // Path where policy for components will be cached. |
| 95 base::FilePath component_policy_cache_path_; |
| 96 |
86 // Manages external data referenced by policies. | 97 // Manages external data referenced by policies. |
87 scoped_ptr<CloudExternalDataManager> external_data_manager_; | 98 scoped_ptr<CloudExternalDataManager> external_data_manager_; |
88 | 99 |
89 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); | 100 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); |
90 }; | 101 }; |
91 | 102 |
92 } // namespace policy | 103 } // namespace policy |
93 | 104 |
94 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_H_ | 105 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_H_ |
OLD | NEW |