15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h"
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/compiler_specific.h"
128bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#include "base/memory/ref_counted.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/weak_ptr.h"
15116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h"
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/chromeos/policy/device_cloud_policy_validator.h"
17c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
18a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "components/policy/core/common/cloud/cloud_policy_client.h"
19a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "components/policy/core/common/cloud/cloud_policy_store.h"
20c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "google_apis/gaia/gaia_oauth_client.h"
215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "policy/proto/device_management_backend.pb.h"
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
238bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)namespace base {
248bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)class SequencedTaskRunner;
258bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)}
268bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
275f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace chromeos {
285f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class DeviceSettingsService;
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace policy {
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
33116680a4aac90f2aa7413d9095a592090648e557Ben Murdochclass DeviceCloudPolicyStoreChromeOS;
34010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)class ServerBackedStateKeysBroker;
35010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Implements the logic that establishes enterprise enrollment for Chromium OS
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// devices. The process is as follows:
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//   1. Given an auth token, register with the policy service.
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//   2. Download the initial policy blob from the service.
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//   3. Verify the policy blob. Everything up to this point doesn't touch device
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//      state.
42c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)//   4. Download the OAuth2 authorization code for device-level API access.
43c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)//   5. Download the OAuth2 refresh token for device-level API access and store
44c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)//      it.
45c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)//   6. Establish the device lock in installation-time attributes.
46c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)//   7. Store the policy blob and API refresh token.
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
48c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                                  public CloudPolicyStore::Observer,
49c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                                  public gaia::GaiaOAuthClient::Delegate {
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
51116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  typedef DeviceCloudPolicyInitializer::AllowedDeviceModes
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      AllowedDeviceModes;
53116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  typedef DeviceCloudPolicyInitializer::EnrollmentCallback
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      EnrollmentCallback;
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // |store| and |install_attributes| must remain valid for the life time of the
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // enrollment handler. |allowed_device_modes| determines what device modes
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // are acceptable. If the mode specified by the server is not acceptable,
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // enrollment will fail with an EnrollmentStatus indicating
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // STATUS_REGISTRATION_BAD_MODE.
615f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // |management_mode| should be either ENTERPRISE_MANAGED or CONSUMER_MANAGED.
628bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  EnrollmentHandlerChromeOS(
638bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      DeviceCloudPolicyStoreChromeOS* store,
648bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      EnterpriseInstallAttributes* install_attributes,
65010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      ServerBackedStateKeysBroker* state_keys_broker,
665f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)      chromeos::DeviceSettingsService* device_settings_service,
678bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      scoped_ptr<CloudPolicyClient> client,
688bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      scoped_refptr<base::SequencedTaskRunner> background_task_runner,
698bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      const std::string& auth_token,
708bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      const std::string& client_id,
718bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      bool is_auto_enrollment,
728bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      const std::string& requisition,
738bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      const AllowedDeviceModes& allowed_device_modes,
745f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)      enterprise_management::PolicyData::ManagementMode management_mode,
758bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      const EnrollmentCallback& completion_callback);
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~EnrollmentHandlerChromeOS();
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Starts the enrollment process and reports the result to
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // |completion_callback_|.
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void StartEnrollment();
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Releases the client.
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<CloudPolicyClient> ReleaseClient();
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // CloudPolicyClient::Observer:
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE;
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE;
88c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  virtual void OnRobotAuthCodesFetched(CloudPolicyClient* client) OVERRIDE;
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnClientError(CloudPolicyClient* client) OVERRIDE;
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // CloudPolicyStore::Observer:
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnStoreLoaded(CloudPolicyStore* store) OVERRIDE;
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnStoreError(CloudPolicyStore* store) OVERRIDE;
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
95c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // GaiaOAuthClient::Delegate:
96c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  virtual void OnGetTokensResponse(const std::string& refresh_token,
97c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                                   const std::string& access_token,
98c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                                   int expires_in_seconds) OVERRIDE;
99c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  virtual void OnRefreshTokenResponse(const std::string& access_token,
100c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                                      int expires_in_seconds) OVERRIDE;
101c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  virtual void OnOAuthError() OVERRIDE;
102c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  virtual void OnNetworkError(int response_code) OVERRIDE;
103c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates what step of the process is currently pending. These steps need
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // to be listed in the order they are traversed in.
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  enum EnrollmentStep {
108c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_PENDING,             // Not started yet.
109010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)    STEP_STATE_KEYS,          // Waiting for state keys to become available.
110c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_LOADING_STORE,       // Waiting for |store_| to initialize.
111c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_REGISTRATION,        // Currently registering the client.
112c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_POLICY_FETCH,        // Fetching policy.
113c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_VALIDATION,          // Policy validation.
114c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_ROBOT_AUTH_FETCH,    // Fetching device API auth code.
115c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_ROBOT_AUTH_REFRESH,  // Fetching device API refresh token.
116c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_LOCK_DEVICE,         // Writing installation-time attributes.
1175f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    STEP_STORE_TOKEN_AND_ID,  // Storing DM token and virtual device ID.
1181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)    STEP_STORE_ROBOT_AUTH,    // Encrypting & writing robot refresh token.
119c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_STORE_POLICY,        // Storing policy and API refresh token.
120c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    STEP_FINISHED,            // Enrollment process finished, no further action.
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  };
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
123010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  // Handles the response to a request for server-backed state keys.
1241320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void HandleStateKeysResult(const std::vector<std::string>& state_keys,
1251320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                             bool first_boot);
126010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Starts registration if the store is initialized.
1281320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void StartRegistration();
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1301320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // Handles the policy validation result, proceeding with device lock if
1311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // successful.
1321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void HandlePolicyValidationResult(DeviceCloudPolicyValidator* validator);
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1341320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // Calls InstallAttributes::LockDevice() for enterprise enrollment and
1351320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // DeviceSettingsService::SetManagementSettings() for consumer
1361320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // enrollment.
1375f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  void StartLockDevice();
1385f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
1395f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // Checks the status after SetManagementSettings() is done. Proceeds to
1405f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // robot auth code storing if successful.
1411320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void HandleSetManagementSettingsDone();
142c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
1431320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // Handle callback from InstallAttributes::LockDevice() and retry on failure.
144c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  void HandleLockDeviceResult(
145c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      EnterpriseInstallAttributes::LockResult lock_result);
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1471320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // Initiates storing of robot auth token.
1481320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void StartStoreRobotAuth();
1495f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
150a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // Handles completion of the robot token store operation.
1511320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  void HandleStoreRobotAuthTokenResult(bool result);
152a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Drops any ongoing actions.
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void Stop();
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Reports the result of the enrollment process to the initiator.
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ReportResult(EnrollmentStatus status);
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DeviceCloudPolicyStoreChromeOS* store_;
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  EnterpriseInstallAttributes* install_attributes_;
161010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  ServerBackedStateKeysBroker* state_keys_broker_;
1625f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  chromeos::DeviceSettingsService* device_settings_service_;
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<CloudPolicyClient> client_;
1648bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  scoped_refptr<base::SequencedTaskRunner> background_task_runner_;
165c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_;
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::string auth_token_;
1682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  std::string client_id_;
1692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  bool is_auto_enrollment_;
17090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  std::string requisition_;
171effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch  std::string current_state_key_;
1721e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  std::string refresh_token_;
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  AllowedDeviceModes allowed_device_modes_;
1745f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  enterprise_management::PolicyData::ManagementMode management_mode_;
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  EnrollmentCallback completion_callback_;
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The device mode as received in the registration request.
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DeviceMode device_mode_;
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
180c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // The validated policy response info to be installed in the store.
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<enterprise_management::PolicyFetchResponse> policy_;
182c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  std::string username_;
183c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  std::string device_id_;
1845f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  std::string request_token_;
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Current enrollment step.
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  EnrollmentStep enrollment_step_;
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Total amount of time in milliseconds spent waiting for lockbox
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // initialization.
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int lockbox_init_duration_;
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1931e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  base::WeakPtrFactory<EnrollmentHandlerChromeOS> weak_ptr_factory_;
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(EnrollmentHandlerChromeOS);
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace policy
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_
201