OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_
impl.h" | 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_
impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 policy::DeviceCloudPolicyInitializer::AllowedDeviceModes device_modes; | 160 policy::DeviceCloudPolicyInitializer::AllowedDeviceModes device_modes; |
161 device_modes[policy::DEVICE_MODE_ENTERPRISE] = true; | 161 device_modes[policy::DEVICE_MODE_ENTERPRISE] = true; |
162 connector->ScheduleServiceInitialization(0); | 162 connector->ScheduleServiceInitialization(0); |
163 | 163 |
164 policy::DeviceCloudPolicyInitializer* dcp_initializer = | 164 policy::DeviceCloudPolicyInitializer* dcp_initializer = |
165 connector->GetDeviceCloudPolicyInitializer(); | 165 connector->GetDeviceCloudPolicyInitializer(); |
166 CHECK(dcp_initializer); | 166 CHECK(dcp_initializer); |
167 dcp_initializer->StartEnrollment( | 167 dcp_initializer->StartEnrollment( |
168 policy::MANAGEMENT_MODE_ENTERPRISE_MANAGED, | 168 policy::MANAGEMENT_MODE_ENTERPRISE_MANAGED, |
169 connector->device_management_service(), | 169 connector->device_management_service(), |
170 token, | 170 nullptr /* owner_settings_service */, token, device_modes, |
171 device_modes, | |
172 base::Bind(&EnterpriseEnrollmentHelperImpl::OnEnrollmentFinished, | 171 base::Bind(&EnterpriseEnrollmentHelperImpl::OnEnrollmentFinished, |
173 weak_ptr_factory_.GetWeakPtr())); | 172 weak_ptr_factory_.GetWeakPtr())); |
174 } | 173 } |
175 | 174 |
176 void EnterpriseEnrollmentHelperImpl::OnTokenFetched( | 175 void EnterpriseEnrollmentHelperImpl::OnTokenFetched( |
177 size_t fetcher_index, | 176 size_t fetcher_index, |
178 const std::string& token, | 177 const std::string& token, |
179 const GoogleServiceAuthError& error) { | 178 const GoogleServiceAuthError& error) { |
180 CHECK_LT(fetcher_index, oauth_fetchers_.size()); | 179 CHECK_LT(fetcher_index, oauth_fetchers_.size()); |
181 | 180 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 std::vector<base::Closure> callbacks_to_run; | 378 std::vector<base::Closure> callbacks_to_run; |
380 callbacks_to_run.swap(auth_clear_callbacks_); | 379 callbacks_to_run.swap(auth_clear_callbacks_); |
381 for (std::vector<base::Closure>::iterator callback(callbacks_to_run.begin()); | 380 for (std::vector<base::Closure>::iterator callback(callbacks_to_run.begin()); |
382 callback != callbacks_to_run.end(); | 381 callback != callbacks_to_run.end(); |
383 ++callback) { | 382 ++callback) { |
384 callback->Run(); | 383 callback->Run(); |
385 } | 384 } |
386 } | 385 } |
387 | 386 |
388 } // namespace chromeos | 387 } // namespace chromeos |
OLD | NEW |