| Index: chrome/browser/chromeos/policy/enrollment_handler_chromeos.h
|
| diff --git a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h
|
| index 6966101871332f50f9b3aff7da3ab1c86d4670a4..a216297529f180b2b935b0004627442215ff1dd9 100644
|
| --- a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h
|
| +++ b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.h
|
| @@ -27,6 +27,9 @@ class SequencedTaskRunner;
|
| }
|
|
|
| namespace chromeos {
|
| +
|
| +class ActiveDirectoryJoinDelegate;
|
| +
|
| namespace attestation {
|
| class AttestationFlow;
|
| }
|
| @@ -65,6 +68,7 @@ class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
|
| chromeos::attestation::AttestationFlow* attestation_flow,
|
| std::unique_ptr<CloudPolicyClient> client,
|
| scoped_refptr<base::SequencedTaskRunner> background_task_runner,
|
| + chromeos::ActiveDirectoryJoinDelegate* ad_join_delegate,
|
| const EnrollmentConfig& enrollment_config,
|
| const std::string& auth_token,
|
| const std::string& client_id,
|
| @@ -111,12 +115,13 @@ class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
|
| STEP_VALIDATION = 5, // Policy validation.
|
| STEP_ROBOT_AUTH_FETCH = 6, // Fetching device API auth code.
|
| STEP_ROBOT_AUTH_REFRESH = 7, // Fetching device API refresh token.
|
| - STEP_LOCK_DEVICE = 8, // Writing installation-time attributes.
|
| - STEP_STORE_TOKEN = 9, // Encrypting and storing DM token.
|
| - STEP_STORE_ROBOT_AUTH = 10, // Encrypting & writing robot refresh token.
|
| - STEP_STORE_POLICY = 11, // Storing policy and API refresh token. For
|
| + STEP_AD_DOMAIN_JOIN = 8, // Joining Active Directory domain.
|
| + STEP_LOCK_DEVICE = 9, // Writing installation-time attributes.
|
| + STEP_STORE_TOKEN = 10, // Encrypting and storing DM token.
|
| + STEP_STORE_ROBOT_AUTH = 11, // Encrypting & writing robot refresh token.
|
| + STEP_STORE_POLICY = 12, // Storing policy and API refresh token. For
|
| // AD, includes policy fetch via authpolicyd.
|
| - STEP_FINISHED = 12, // Enrollment process done, no further action.
|
| + STEP_FINISHED = 13, // Enrollment process done, no further action.
|
| };
|
|
|
| // Handles the response to a request for server-backed state keys.
|
| @@ -137,6 +142,13 @@ class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
|
| // successful.
|
| void HandlePolicyValidationResult(DeviceCloudPolicyValidator* validator);
|
|
|
| + // Start joining the Active Directory domain in case the device is enrolling
|
| + // into Active Directory management mode.
|
| + void StartJoinAdDomain();
|
| +
|
| + // Handles successful Active Directory domain join.
|
| + void OnAdDomainJoined(const std::string& realm);
|
| +
|
| // Calls InstallAttributes::LockDevice() for enterprise enrollment and
|
| // DeviceSettingsService::SetManagementSettings() for consumer
|
| // enrollment.
|
| @@ -176,6 +188,7 @@ class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
|
| chromeos::attestation::AttestationFlow* attestation_flow_;
|
| std::unique_ptr<CloudPolicyClient> client_;
|
| scoped_refptr<base::SequencedTaskRunner> background_task_runner_;
|
| + chromeos::ActiveDirectoryJoinDelegate* ad_join_delegate_ = nullptr;
|
| std::unique_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_;
|
| std::unique_ptr<policy::DMTokenStorage> dm_token_storage_;
|
|
|
| @@ -189,10 +202,10 @@ class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
|
| std::string current_state_key_;
|
|
|
| // The device mode as received in the registration request.
|
| - DeviceMode device_mode_;
|
| + DeviceMode device_mode_ = DEVICE_MODE_NOT_SET;
|
|
|
| // Whether the server signaled to skip robot auth setup.
|
| - bool skip_robot_auth_;
|
| + bool skip_robot_auth_ = false;
|
|
|
| // The robot account refresh token.
|
| std::string robot_refresh_token_;
|
| @@ -200,6 +213,7 @@ class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
|
| // The validated policy response info to be installed in the store.
|
| std::unique_ptr<enterprise_management::PolicyFetchResponse> policy_;
|
| std::string domain_;
|
| + std::string realm_;
|
| std::string device_id_;
|
|
|
| // Current enrollment step.
|
| @@ -207,7 +221,7 @@ class EnrollmentHandlerChromeOS : public CloudPolicyClient::Observer,
|
|
|
| // Total amount of time in milliseconds spent waiting for lockbox
|
| // initialization.
|
| - int lockbox_init_duration_;
|
| + int lockbox_init_duration_ = 0;
|
|
|
| base::WeakPtrFactory<EnrollmentHandlerChromeOS> weak_ptr_factory_;
|
|
|
|
|