Chromium Code Reviews| Index: chrome/browser/policy/user_cloud_policy_manager.h |
| diff --git a/chrome/browser/policy/user_cloud_policy_manager.h b/chrome/browser/policy/user_cloud_policy_manager.h |
| index 3f74a6c52b5efa788c35939fdd34f4a8e2344dcd..1cc2994ddc8a884abf28b855b74a68e071fe719c 100644 |
| --- a/chrome/browser/policy/user_cloud_policy_manager.h |
| +++ b/chrome/browser/policy/user_cloud_policy_manager.h |
| @@ -6,11 +6,11 @@ |
| #define CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_ |
| #include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "chrome/browser/policy/cloud_policy_client.h" |
| #include "chrome/browser/policy/cloud_policy_constants.h" |
| -#include "chrome/browser/policy/cloud_policy_store.h" |
| -#include "chrome/browser/policy/configuration_policy_provider.h" |
| +#include "chrome/browser/policy/cloud_policy_manager.h" |
| class PrefService; |
| class Profile; |
| @@ -24,9 +24,8 @@ class DeviceManagementService; |
| // UserCloudPolicyManager keeps track of all things user policy, drives the |
| // corresponding cloud policy service and publishes policy through the |
| // ConfigurationPolicyProvider interface. |
| -class UserCloudPolicyManager : public ConfigurationPolicyProvider, |
| - public CloudPolicyClient::Observer, |
| - public CloudPolicyStore::Observer { |
| +class UserCloudPolicyManager : public CloudPolicyManager, |
| + public CloudPolicyClient::Observer { |
| public: |
| // If |wait_for_policy| fetch is true, IsInitializationComplete() will return |
| // false as long as there hasn't been a successful policy fetch. |
| @@ -39,11 +38,11 @@ class UserCloudPolicyManager : public ConfigurationPolicyProvider, |
| static scoped_ptr<UserCloudPolicyManager> Create(Profile* profile, |
| bool wait_for_policy_fetch); |
| - // Initializes the cloud connection. |local_prefs| and |service| must stay |
| + // Initializes the cloud connection. |local_state| and |service| must stay |
| // valid until this object is deleted or ShutdownAndRemovePolicy() gets |
| // called. Virtual for mocking. |
| - virtual void Initialize(PrefService* local_prefs, |
| - DeviceManagementService* service, |
| + virtual void Initialize(PrefService* local_state, |
| + DeviceManagementService* device_management_service, |
| UserAffiliation user_affiliation); |
| // Shuts down the UserCloudPolicyManager (removes and stops refreshing the |
| @@ -64,51 +63,25 @@ class UserCloudPolicyManager : public ConfigurationPolicyProvider, |
| // Register the CloudPolicyClient using the passed OAuth token. |
| void RegisterClient(const std::string& access_token); |
|
Joao da Silva
2012/09/07 12:44:13
#include <string>
Mattias Nissler (ping if slow)
2012/09/07 13:12:59
Done.
|
| - CloudPolicyService* cloud_policy_service() { return service_.get(); } |
| - |
| // ConfigurationPolicyProvider: |
| virtual bool IsInitializationComplete() const OVERRIDE; |
| - virtual void RefreshPolicies() OVERRIDE; |
| // CloudPolicyClient::Observer: |
| virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE; |
| virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE; |
| virtual void OnClientError(CloudPolicyClient* client) OVERRIDE; |
| - // CloudPolicyStore::Observer: |
| - virtual void OnStoreLoaded(CloudPolicyStore* store) OVERRIDE; |
| - virtual void OnStoreError(CloudPolicyStore* store) OVERRIDE; |
| - |
| private: |
| - // Check whether fully initialized and if so, publish policy by calling |
| - // ConfigurationPolicyStore::UpdatePolicy(). |
| - void CheckAndPublishPolicy(); |
| - |
| // Completion handler for the explicit policy fetch triggered on startup in |
| // case |wait_for_policy_fetch_| is true. |
| void OnInitialPolicyFetchComplete(); |
| - // Completion handler for policy refresh operations. |
| - void OnRefreshComplete(); |
| - |
| - // Frees the CloudPolicyService and stops refreshing policy. Any previously |
| - // cached policy will continue to be served. |
| - void Shutdown(); |
| - |
| // Whether to wait for a policy fetch to complete before reporting |
| // IsInitializationComplete(). |
| bool wait_for_policy_fetch_; |
| - // Whether there's a policy refresh operation pending, in which case all |
| - // policy update notifications are deferred until after it completes. |
| - bool wait_for_policy_refresh_; |
| - |
| - scoped_ptr<CloudPolicyStore> store_; |
| - scoped_ptr<CloudPolicyService> service_; |
| - scoped_ptr<CloudPolicyRefreshScheduler> refresh_scheduler_; |
| - |
| // The pref service to pass to the refresh scheduler on initialization. |
| - PrefService* prefs_; |
| + PrefService* local_state_; |
| DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); |
| }; |