| Index: chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
|
| diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
|
| index 4716d6b77ad879640693c3850d77a7c77e9b2f33..4b3107f8ef16eea35b461268fa9abb96b3059809 100644
|
| --- a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
|
| +++ b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/callback.h"
|
| +#include "base/command_line.h"
|
| #include "base/logging.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/sequenced_task_runner.h"
|
| @@ -36,6 +37,10 @@
|
| #include "components/prefs/pref_service.h"
|
| #include "net/url_request/url_request_context_getter.h"
|
|
|
| +namespace chromeos {
|
| +class ActiveDirectoryJoinDelegate;
|
| +}
|
| +
|
| namespace policy {
|
|
|
| DeviceCloudPolicyInitializer::DeviceCloudPolicyInitializer(
|
| @@ -93,6 +98,7 @@ void DeviceCloudPolicyInitializer::Shutdown() {
|
|
|
| void DeviceCloudPolicyInitializer::StartEnrollment(
|
| DeviceManagementService* device_management_service,
|
| + chromeos::ActiveDirectoryJoinDelegate* ad_join_delegate,
|
| const EnrollmentConfig& enrollment_config,
|
| const std::string& auth_token,
|
| const EnrollmentCallback& enrollment_callback) {
|
| @@ -100,14 +106,17 @@ void DeviceCloudPolicyInitializer::StartEnrollment(
|
| DCHECK(!enrollment_handler_);
|
|
|
| manager_->core()->Disconnect();
|
| - // TODO(rsorokin): make proper SetDeviceRequisition
|
| - if (!enrollment_config.management_realm.empty())
|
| + // TODO(rsorokin): Remove that once DM server does not require requisition.
|
| + // See crbug.com/668455
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + chromeos::switches::kEnableAd)) {
|
| manager_->SetDeviceRequisition("chrome_ad");
|
| + }
|
|
|
| enrollment_handler_.reset(new EnrollmentHandlerChromeOS(
|
| device_store_, install_attributes_, state_keys_broker_,
|
| attestation_flow_.get(), CreateClient(device_management_service),
|
| - background_task_runner_, enrollment_config, auth_token,
|
| + background_task_runner_, ad_join_delegate, enrollment_config, auth_token,
|
| install_attributes_->GetDeviceId(), manager_->GetDeviceRequisition(),
|
| base::Bind(&DeviceCloudPolicyInitializer::EnrollmentCompleted,
|
| base::Unretained(this), enrollment_callback)));
|
|
|