OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/policy/enrollment_handler_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 void EnrollmentHandlerChromeOS::HandlePolicyValidationResult( | 256 void EnrollmentHandlerChromeOS::HandlePolicyValidationResult( |
257 DeviceCloudPolicyValidator* validator) { | 257 DeviceCloudPolicyValidator* validator) { |
258 CHECK_EQ(STEP_VALIDATION, enrollment_step_); | 258 CHECK_EQ(STEP_VALIDATION, enrollment_step_); |
259 if (validator->success()) { | 259 if (validator->success()) { |
260 policy_ = validator->policy().Pass(); | 260 policy_ = validator->policy().Pass(); |
261 username_ = validator->policy_data()->username(); | 261 username_ = validator->policy_data()->username(); |
262 device_id_ = validator->policy_data()->device_id(); | 262 device_id_ = validator->policy_data()->device_id(); |
263 request_token_ = validator->policy_data()->request_token(); | 263 request_token_ = validator->policy_data()->request_token(); |
264 | 264 |
265 if (CommandLine::ForCurrentProcess()->HasSwitch( | 265 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
266 chromeos::switches::kEnterpriseEnrollmentSkipRobotAuth)) { | 266 chromeos::switches::kEnterpriseEnrollmentSkipRobotAuth)) { |
267 // For test purposes we allow enrollment to succeed without proper robot | 267 // For test purposes we allow enrollment to succeed without proper robot |
268 // account and use the provided value as a token. | 268 // account and use the provided value as a token. |
269 refresh_token_ = kTestingRobotToken; | 269 refresh_token_ = kTestingRobotToken; |
270 enrollment_step_ = STEP_LOCK_DEVICE; | 270 enrollment_step_ = STEP_LOCK_DEVICE; |
271 StartLockDevice(); | 271 StartLockDevice(); |
272 return; | 272 return; |
273 } | 273 } |
274 | 274 |
275 enrollment_step_ = STEP_ROBOT_AUTH_FETCH; | 275 enrollment_step_ = STEP_ROBOT_AUTH_FETCH; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 << ", validation: " << status.validation_status() | 462 << ", validation: " << status.validation_status() |
463 << ", store: " << status.store_status() | 463 << ", store: " << status.store_status() |
464 << ", lock: " << status.lock_status(); | 464 << ", lock: " << status.lock_status(); |
465 } | 465 } |
466 | 466 |
467 if (!callback.is_null()) | 467 if (!callback.is_null()) |
468 callback.Run(status); | 468 callback.Run(status); |
469 } | 469 } |
470 | 470 |
471 } // namespace policy | 471 } // namespace policy |
OLD | NEW |