| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 std::string enrollment_domain = GetForcedEnrollmentDomain(); | 486 std::string enrollment_domain = GetForcedEnrollmentDomain(); |
| 487 if (is_auto_enrollment) { | 487 if (is_auto_enrollment) { |
| 488 mode = EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; | 488 mode = EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; |
| 489 } else if (enrollment_recovery_) { | 489 } else if (enrollment_recovery_) { |
| 490 mode = EnrollmentScreenActor::ENROLLMENT_MODE_RECOVERY; | 490 mode = EnrollmentScreenActor::ENROLLMENT_MODE_RECOVERY; |
| 491 enrollment_domain = GetEnrollmentRecoveryDomain(); | 491 enrollment_domain = GetEnrollmentRecoveryDomain(); |
| 492 } else if (ShouldAutoStartEnrollment() && !CanExitEnrollment()) { | 492 } else if (ShouldAutoStartEnrollment() && !CanExitEnrollment()) { |
| 493 mode = EnrollmentScreenActor::ENROLLMENT_MODE_FORCED; | 493 mode = EnrollmentScreenActor::ENROLLMENT_MODE_FORCED; |
| 494 } | 494 } |
| 495 | 495 |
| 496 screen->SetParameters(mode, enrollment_domain, user); | 496 screen->SetParameters(mode, enrollment_domain, user, auth_token_); |
| 497 SetCurrentScreen(screen); | 497 SetCurrentScreen(screen); |
| 498 } | 498 } |
| 499 | 499 |
| 500 void WizardController::ShowResetScreen() { | 500 void WizardController::ShowResetScreen() { |
| 501 VLOG(1) << "Showing reset screen."; | 501 VLOG(1) << "Showing reset screen."; |
| 502 SetStatusAreaVisible(false); | 502 SetStatusAreaVisible(false); |
| 503 SetCurrentScreen(GetResetScreen()); | 503 SetCurrentScreen(GetResetScreen()); |
| 504 } | 504 } |
| 505 | 505 |
| 506 void WizardController::ShowKioskEnableScreen() { | 506 void WizardController::ShowKioskEnableScreen() { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // TODO(dpolukhin): show error message after login screen is displayed. | 629 // TODO(dpolukhin): show error message after login screen is displayed. |
| 630 ShowLoginScreen(LoginScreenContext()); | 630 ShowLoginScreen(LoginScreenContext()); |
| 631 } | 631 } |
| 632 | 632 |
| 633 void WizardController::OnUpdateCompleted() { | 633 void WizardController::OnUpdateCompleted() { |
| 634 // TODO(dzhioev): place checks related to pairing in a proper place. | 634 // TODO(dzhioev): place checks related to pairing in a proper place. |
| 635 if (ShouldShowControllerPairingScreen()) { | 635 if (ShouldShowControllerPairingScreen()) { |
| 636 ShowControllerPairingScreen(); | 636 ShowControllerPairingScreen(); |
| 637 } else if (ShouldShowHostPairingScreen()) { | 637 } else if (ShouldShowHostPairingScreen()) { |
| 638 ShowHostPairingScreen(); | 638 ShowHostPairingScreen(); |
| 639 } else if (!auth_token_.empty()) { |
| 640 // TODO(achuith): There is an issue with the auto enrollment check and |
| 641 // remote enrollment. crbug.com/403147. |
| 642 ShowEnrollmentScreen(); |
| 639 } else { | 643 } else { |
| 640 ShowAutoEnrollmentCheckScreen(); | 644 ShowAutoEnrollmentCheckScreen(); |
| 641 } | 645 } |
| 642 } | 646 } |
| 643 | 647 |
| 644 void WizardController::OnEulaAccepted() { | 648 void WizardController::OnEulaAccepted() { |
| 645 time_eula_accepted_ = base::Time::Now(); | 649 time_eula_accepted_ = base::Time::Now(); |
| 646 StartupUtils::MarkEulaAccepted(); | 650 StartupUtils::MarkEulaAccepted(); |
| 647 bool uma_enabled = | 651 bool uma_enabled = |
| 648 ResolveMetricsReportingEnabled(usage_statistics_reporting_); | 652 ResolveMetricsReportingEnabled(usage_statistics_reporting_); |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 | 1279 |
| 1276 bool WizardController::SetOnTimeZoneResolvedForTesting( | 1280 bool WizardController::SetOnTimeZoneResolvedForTesting( |
| 1277 const base::Closure& callback) { | 1281 const base::Closure& callback) { |
| 1278 if (timezone_resolved_) | 1282 if (timezone_resolved_) |
| 1279 return false; | 1283 return false; |
| 1280 | 1284 |
| 1281 on_timezone_resolved_for_testing_ = callback; | 1285 on_timezone_resolved_for_testing_ = callback; |
| 1282 return true; | 1286 return true; |
| 1283 } | 1287 } |
| 1284 | 1288 |
| 1289 void WizardController::OnEnrollmentAuthTokenReceived( |
| 1290 const std::string& token) { |
| 1291 // TODO(achuith, zork): This will be called via Bluetooth from a remote |
| 1292 // controller. |
| 1293 VLOG(1) << "OnEnrollmentAuthTokenReceived " << token; |
| 1294 if (ShouldAutoStartEnrollment() || ShouldRecoverEnrollment()) { |
| 1295 StartupUtils::MarkEulaAccepted(); |
| 1296 auth_token_ = token; |
| 1297 InitiateOOBEUpdate(); |
| 1298 } else { |
| 1299 LOG(WARNING) << "Not in device enrollment."; |
| 1300 } |
| 1301 } |
| 1302 |
| 1285 } // namespace chromeos | 1303 } // namespace chromeos |
| OLD | NEW |