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

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

Issue 10693022: Add support for loading user cloud policy on desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed redundant #ifdef OS_CHROMEOS guard Created 8 years, 4 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 8db19d03274f47c1be9e8bba9c9c2ca67fa578bc..98c59e2670f508478aa0f54cbefda4edfe388851 100644
--- a/chrome/browser/policy/user_cloud_policy_manager.h
+++ b/chrome/browser/policy/user_cloud_policy_manager.h
@@ -13,6 +13,7 @@
#include "chrome/browser/policy/configuration_policy_provider.h"
class PrefService;
+class Profile;
namespace policy {
@@ -33,23 +34,32 @@ class UserCloudPolicyManager : public ConfigurationPolicyProvider,
bool wait_for_policy_fetch);
virtual ~UserCloudPolicyManager();
-#if defined(OS_CHROMEOS)
- // Creates a UserCloudPolicyService instance for the Chrome OS platform.
- static scoped_ptr<UserCloudPolicyManager> Create(bool wait_for_policy_fetch);
-#endif
+ // Creates a UserCloudPolicyService instance associated with the passed
+ // |profile|.
+ static scoped_ptr<UserCloudPolicyManager> Create(Profile* profile,
+ bool wait_for_policy_fetch);
- // Initializes the cloud connection. |prefs| and |service| must stay valid
- // until Shutdown() gets called.
- void Initialize(PrefService* prefs,
- DeviceManagementService* service,
- UserAffiliation user_affiliation);
- void Shutdown();
+ // Initializes the cloud connection. |local_prefs| and |service| must stay
+ // valid until Shutdown() gets called. Virtual for mocking.
+ virtual void Initialize(PrefService* local_prefs,
+ DeviceManagementService* service,
+ UserAffiliation user_affiliation);
+
+ // Virtual for mocks.
+ virtual void Shutdown();
// Cancels waiting for the policy fetch and flags the
// ConfigurationPolicyProvider ready (assuming all other initialization tasks
// have completed).
void CancelWaitForPolicyFetch();
+ // Returns true if the underlying CloudPolicyClient is already registered.
+ // Virtual for mocking.
+ virtual bool IsClientRegistered() const;
+
+ // Register the CloudPolicyClient using the passed OAuth token.
+ void RegisterClient(const std::string& access_token);
+
CloudPolicyService* cloud_policy_service() { return service_.get(); }
// ConfigurationPolicyProvider:

Powered by Google App Engine
This is Rietveld 408576698