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

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

Issue 10928036: Implement Chrome OS device enrollment on the new cloud policy stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/device_cloud_policy_manager_chromeos.h
diff --git a/chrome/browser/policy/device_cloud_policy_manager_chromeos.h b/chrome/browser/policy/device_cloud_policy_manager_chromeos.h
index 0ea34019b7bee5fcf2b97c17d7539e44eeb974e6..ea50a31396bdf0a2a622658877468ecbfa87b198 100644
--- a/chrome/browser/policy/device_cloud_policy_manager_chromeos.h
+++ b/chrome/browser/policy/device_cloud_policy_manager_chromeos.h
@@ -23,11 +23,19 @@ namespace policy {
class CloudPolicyClient;
class DeviceCloudPolicyStoreChromeOS;
class DeviceManagementService;
+class EnrollmentHandlerChromeOS;
class EnterpriseInstallAttributes;
-// CloudPolicyManager specialization for device policy on Chrome OS.
+// CloudPolicyManager specialization for device policy on Chrome OS. The most
+// significant addition is support for device enrollment.
class DeviceCloudPolicyManagerChromeOS : public CloudPolicyManager {
public:
+ typedef base::Callback<void(EnrollmentStatus,
+ DeviceManagementStatus,
+ CloudPolicyValidatorBase::Status,
+ CloudPolicyStore::Status)>
+ EnrollmentCallback;
+
DeviceCloudPolicyManagerChromeOS(
scoped_ptr<DeviceCloudPolicyStoreChromeOS> store,
EnterpriseInstallAttributes* install_attributes);
@@ -40,6 +48,14 @@ class DeviceCloudPolicyManagerChromeOS : public CloudPolicyManager {
// Shuts down the cloud connection.
void Shutdown();
+ // Starts enrollment or re-enrollment. Once the enrollment process completes,
+ // |callback| is invoked, indicating success.
Joao da Silva 2012/09/07 14:01:42 "indicating success" is a bit misleading, since th
Mattias Nissler (ping if slow) 2012/10/23 15:30:41 Done.
+ void StartEnrollment(const std::string& auth_token,
+ const EnrollmentCallback& callback);
+
+ // Cancels a pending enrollment operation, if any.
+ void CancelEnrollment();
+
// CloudPolicyStore::Observer:
virtual void OnStoreLoaded(CloudPolicyStore* store) OVERRIDE;
@@ -56,6 +72,13 @@ class DeviceCloudPolicyManagerChromeOS : public CloudPolicyManager {
// Starts regular operation if |store_| has policy and is initialized.
void StartIfInitialized();
+ // Handles completion signaled by |enrollment_handler_|.
+ void EnrollmentCompleted(const EnrollmentCallback& callback,
+ EnrollmentStatus status,
+ DeviceManagementStatus dm_status,
+ CloudPolicyValidatorBase::Status validator_status,
+ CloudPolicyStore::Status store_status);
+
// Points to the same object as the base CloudPolicyManager::store(), but with
// actual device policy specific type.
DeviceCloudPolicyStoreChromeOS* device_store_;
@@ -66,6 +89,9 @@ class DeviceCloudPolicyManagerChromeOS : public CloudPolicyManager {
// PrefService instance to read the policy refresh rate from.
PrefService* local_state_;
+ // Non-null if there is an enrollment operation pending.
+ scoped_ptr<EnrollmentHandlerChromeOS> enrollment_handler_;
+
DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyManagerChromeOS);
};

Powered by Google App Engine
This is Rietveld 408576698