Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3858)

Unified Diff: chrome/browser/policy/user_cloud_policy_manager.h

Issue 10919131: Break out base functionality of UserCloudPolicyManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, address comments, fix compilation. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..a81c2841612eed36472e07bb2e30e7a3ba173597 100644
--- a/chrome/browser/policy/user_cloud_policy_manager.h
+++ b/chrome/browser/policy/user_cloud_policy_manager.h
@@ -5,28 +5,27 @@
#ifndef CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_
#define CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_
+#include <string>
+
#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;
namespace policy {
-class CloudPolicyRefreshScheduler;
-class CloudPolicyService;
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.
@@ -34,16 +33,16 @@ class UserCloudPolicyManager : public ConfigurationPolicyProvider,
bool wait_for_policy_fetch);
virtual ~UserCloudPolicyManager();
- // Creates a UserCloudPolicyService instance associated with the passed
+ // Creates a UserCloudPolicyManager instance associated with the passed
// |profile|.
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);
- 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);
};

Powered by Google App Engine
This is Rietveld 408576698