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/login/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 std::string enrollment_domain = GetForcedEnrollmentDomain(); | 499 std::string enrollment_domain = GetForcedEnrollmentDomain(); |
500 if (is_auto_enrollment) { | 500 if (is_auto_enrollment) { |
501 mode = EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; | 501 mode = EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; |
502 } else if (enrollment_recovery_) { | 502 } else if (enrollment_recovery_) { |
503 mode = EnrollmentScreenActor::ENROLLMENT_MODE_RECOVERY; | 503 mode = EnrollmentScreenActor::ENROLLMENT_MODE_RECOVERY; |
504 enrollment_domain = GetEnrollmentRecoveryDomain(); | 504 enrollment_domain = GetEnrollmentRecoveryDomain(); |
505 } else if (ShouldAutoStartEnrollment() && !CanExitEnrollment()) { | 505 } else if (ShouldAutoStartEnrollment() && !CanExitEnrollment()) { |
506 mode = EnrollmentScreenActor::ENROLLMENT_MODE_FORCED; | 506 mode = EnrollmentScreenActor::ENROLLMENT_MODE_FORCED; |
507 } | 507 } |
508 | 508 |
509 screen->SetParameters(mode, enrollment_domain, user); | 509 screen->SetParameters(mode, enrollment_domain, user, auth_token_); |
510 SetCurrentScreen(screen); | 510 SetCurrentScreen(screen); |
511 } | 511 } |
512 | 512 |
513 void WizardController::ShowResetScreen() { | 513 void WizardController::ShowResetScreen() { |
514 VLOG(1) << "Showing reset screen."; | 514 VLOG(1) << "Showing reset screen."; |
515 SetStatusAreaVisible(false); | 515 SetStatusAreaVisible(false); |
516 SetCurrentScreen(GetResetScreen()); | 516 SetCurrentScreen(GetResetScreen()); |
517 } | 517 } |
518 | 518 |
519 void WizardController::ShowKioskEnableScreen() { | 519 void WizardController::ShowKioskEnableScreen() { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 // TODO(dpolukhin): show error message after login screen is displayed. | 642 // TODO(dpolukhin): show error message after login screen is displayed. |
643 ShowLoginScreen(LoginScreenContext()); | 643 ShowLoginScreen(LoginScreenContext()); |
644 } | 644 } |
645 | 645 |
646 void WizardController::OnUpdateCompleted() { | 646 void WizardController::OnUpdateCompleted() { |
647 // TODO(dzhioev): place checks related to pairing in a proper place. | 647 // TODO(dzhioev): place checks related to pairing in a proper place. |
648 if (ShouldShowControllerPairingScreen()) { | 648 if (ShouldShowControllerPairingScreen()) { |
649 ShowControllerPairingScreen(); | 649 ShowControllerPairingScreen(); |
650 } else if (ShouldShowHostPairingScreen()) { | 650 } else if (ShouldShowHostPairingScreen()) { |
651 ShowHostPairingScreen(); | 651 ShowHostPairingScreen(); |
| 652 } else if (!auth_token_.empty()) { |
| 653 // TODO(achuith): There is an issue with the auto enrollment check and |
| 654 // remote enrollment. crbug.com/403147. |
| 655 ShowEnrollmentScreen(); |
652 } else { | 656 } else { |
653 ShowAutoEnrollmentCheckScreen(); | 657 ShowAutoEnrollmentCheckScreen(); |
654 } | 658 } |
655 } | 659 } |
656 | 660 |
657 void WizardController::OnEulaAccepted() { | 661 void WizardController::OnEulaAccepted() { |
658 time_eula_accepted_ = base::Time::Now(); | 662 time_eula_accepted_ = base::Time::Now(); |
659 StartupUtils::MarkEulaAccepted(); | 663 StartupUtils::MarkEulaAccepted(); |
660 bool uma_enabled = | 664 bool uma_enabled = |
661 ResolveMetricsReportingEnabled(usage_statistics_reporting_); | 665 ResolveMetricsReportingEnabled(usage_statistics_reporting_); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 | 1292 |
1289 bool WizardController::SetOnTimeZoneResolvedForTesting( | 1293 bool WizardController::SetOnTimeZoneResolvedForTesting( |
1290 const base::Closure& callback) { | 1294 const base::Closure& callback) { |
1291 if (timezone_resolved_) | 1295 if (timezone_resolved_) |
1292 return false; | 1296 return false; |
1293 | 1297 |
1294 on_timezone_resolved_for_testing_ = callback; | 1298 on_timezone_resolved_for_testing_ = callback; |
1295 return true; | 1299 return true; |
1296 } | 1300 } |
1297 | 1301 |
| 1302 void WizardController::OnEnrollmentAuthTokenReceived( |
| 1303 const std::string& token) { |
| 1304 // TODO(achuith, zork): This is called via bluetooth from a remote controller. |
| 1305 VLOG(1) << "OnEnrollmentAuthTokenReceived " << token; |
| 1306 if (ShouldAutoStartEnrollment() || ShouldRecoverEnrollment()) { |
| 1307 StartupUtils::MarkEulaAccepted(); |
| 1308 auth_token_ = token; |
| 1309 InitiateOOBEUpdate(); |
| 1310 } else { |
| 1311 LOG(WARNING) << "Not in device enrollment."; |
| 1312 } |
| 1313 } |
| 1314 |
1298 } // namespace chromeos | 1315 } // namespace chromeos |
OLD | NEW |