Chromium Code Reviews| 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/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 "chrome/browser/policy/cloud/cloud_policy_manager.h" | 14 #include "chrome/browser/policy/cloud/cloud_policy_manager.h" |
| 15 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" | 15 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" |
| 16 | 16 |
| 17 class PrefService; | 17 class PrefService; |
| 18 class Profile; | |
| 19 | 18 |
| 20 namespace base { | 19 namespace base { |
| 21 class SequencedTaskRunner; | 20 class SequencedTaskRunner; |
| 22 } | 21 } |
| 23 | 22 |
| 23 namespace content { | |
| 24 class BrowserContext; | |
| 25 } | |
| 26 | |
| 24 namespace net { | 27 namespace net { |
| 25 class URLRequestContextGetter; | 28 class URLRequestContextGetter; |
| 26 } | 29 } |
| 27 | 30 |
| 28 namespace policy { | 31 namespace policy { |
| 29 | 32 |
| 30 class CloudExternalDataManager; | 33 class CloudExternalDataManager; |
| 31 class DeviceManagementService; | 34 class DeviceManagementService; |
| 32 class UserCloudPolicyStore; | 35 class UserCloudPolicyStore; |
| 33 | 36 |
| 34 // UserCloudPolicyManager handles initialization of user policy for Chrome | 37 // UserCloudPolicyManager handles initialization of user policy for Chrome |
| 35 // Profiles on the desktop platforms. | 38 // Profiles on the desktop platforms. |
| 36 class UserCloudPolicyManager : public CloudPolicyManager, | 39 class UserCloudPolicyManager : public CloudPolicyManager, |
| 37 public BrowserContextKeyedService { | 40 public BrowserContextKeyedService { |
| 38 public: | 41 public: |
| 39 // |task_runner| is the runner for policy refresh tasks. | 42 // |task_runner| is the runner for policy refresh tasks. |
| 40 UserCloudPolicyManager( | 43 UserCloudPolicyManager( |
| 41 Profile* profile, | 44 content::BrowserContext* context, |
|
Joao da Silva
2013/11/04 09:53:38
Shouldn't this come in https://codereview.chromium
pneubeck (no reviews)
2013/11/04 12:38:50
Done.
| |
| 42 scoped_ptr<UserCloudPolicyStore> store, | 45 scoped_ptr<UserCloudPolicyStore> store, |
| 43 scoped_ptr<CloudExternalDataManager> external_data_manager, | 46 scoped_ptr<CloudExternalDataManager> external_data_manager, |
| 44 const scoped_refptr<base::SequencedTaskRunner>& task_runner); | 47 const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
| 45 virtual ~UserCloudPolicyManager(); | 48 virtual ~UserCloudPolicyManager(); |
| 46 | 49 |
| 47 virtual void Shutdown() OVERRIDE; | 50 virtual void Shutdown() OVERRIDE; |
| 48 | 51 |
| 49 // Initializes the cloud connection. |local_state| must stay valid until this | 52 // Initializes the cloud connection. |local_state| must stay valid until this |
| 50 // object is deleted or DisconnectAndRemovePolicy() gets called. Virtual for | 53 // object is deleted or DisconnectAndRemovePolicy() gets called. Virtual for |
| 51 // mocking. | 54 // mocking. |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 64 // Virtual for mocking. | 67 // Virtual for mocking. |
| 65 virtual bool IsClientRegistered() const; | 68 virtual bool IsClientRegistered() const; |
| 66 | 69 |
| 67 // Creates a CloudPolicyClient for this client. Used in situations where | 70 // Creates a CloudPolicyClient for this client. Used in situations where |
| 68 // callers want to create a DMToken without actually initializing the | 71 // callers want to create a DMToken without actually initializing the |
| 69 // profile's policy infrastructure. | 72 // profile's policy infrastructure. |
| 70 static scoped_ptr<CloudPolicyClient> CreateCloudPolicyClient( | 73 static scoped_ptr<CloudPolicyClient> CreateCloudPolicyClient( |
| 71 DeviceManagementService* device_management_service); | 74 DeviceManagementService* device_management_service); |
| 72 | 75 |
| 73 private: | 76 private: |
| 74 // The profile this instance belongs to. | 77 // The context this instance belongs to. |
| 75 Profile* profile_; | 78 content::BrowserContext* context_; |
| 76 | 79 |
| 77 // Typed pointer to the store owned by UserCloudPolicyManager. Note that | 80 // Typed pointer to the store owned by UserCloudPolicyManager. Note that |
| 78 // CloudPolicyManager only keeps a plain CloudPolicyStore pointer. | 81 // CloudPolicyManager only keeps a plain CloudPolicyStore pointer. |
| 79 scoped_ptr<UserCloudPolicyStore> store_; | 82 scoped_ptr<UserCloudPolicyStore> store_; |
| 80 | 83 |
| 81 // Manages external data referenced by policies. | 84 // Manages external data referenced by policies. |
| 82 scoped_ptr<CloudExternalDataManager> external_data_manager_; | 85 scoped_ptr<CloudExternalDataManager> external_data_manager_; |
| 83 | 86 |
| 84 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); | 87 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); |
| 85 }; | 88 }; |
| 86 | 89 |
| 87 } // namespace policy | 90 } // namespace policy |
| 88 | 91 |
| 89 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_H_ | 92 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_H_ |
| OLD | NEW |