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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 std::string enrollment_domain = GetForcedEnrollmentDomain(); | 420 std::string enrollment_domain = GetForcedEnrollmentDomain(); |
421 if (is_auto_enrollment) { | 421 if (is_auto_enrollment) { |
422 mode = EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; | 422 mode = EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; |
423 } else if (enrollment_recovery_) { | 423 } else if (enrollment_recovery_) { |
424 mode = EnrollmentScreenActor::ENROLLMENT_MODE_RECOVERY; | 424 mode = EnrollmentScreenActor::ENROLLMENT_MODE_RECOVERY; |
425 enrollment_domain = GetEnrollmentRecoveryDomain(); | 425 enrollment_domain = GetEnrollmentRecoveryDomain(); |
426 } else if (ShouldAutoStartEnrollment() && !CanExitEnrollment()) { | 426 } else if (ShouldAutoStartEnrollment() && !CanExitEnrollment()) { |
427 mode = EnrollmentScreenActor::ENROLLMENT_MODE_FORCED; | 427 mode = EnrollmentScreenActor::ENROLLMENT_MODE_FORCED; |
428 } | 428 } |
429 | 429 |
430 screen->SetParameters(mode, enrollment_domain, user, auth_token_); | 430 screen->SetParameters(mode, enrollment_domain, user, auth_token_, |
431 controller_pairing_controller_.get(), | |
432 host_pairing_controller_.get()); | |
431 SetCurrentScreen(screen); | 433 SetCurrentScreen(screen); |
432 } | 434 } |
433 | 435 |
434 void WizardController::ShowResetScreen() { | 436 void WizardController::ShowResetScreen() { |
435 VLOG(1) << "Showing reset screen."; | 437 VLOG(1) << "Showing reset screen."; |
436 SetStatusAreaVisible(false); | 438 SetStatusAreaVisible(false); |
437 SetCurrentScreen(GetScreen(kResetScreenName)); | 439 SetCurrentScreen(GetScreen(kResetScreenName)); |
438 } | 440 } |
439 | 441 |
440 void WizardController::ShowKioskEnableScreen() { | 442 void WizardController::ShowKioskEnableScreen() { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
619 // TODO(nkostylev): Show message to the user explaining update error. | 621 // TODO(nkostylev): Show message to the user explaining update error. |
620 // TODO(nkostylev): Update should be required during OOBE. | 622 // TODO(nkostylev): Update should be required during OOBE. |
621 // Temporary fix, need to migrate to new API. http://crosbug.com/4321 | 623 // Temporary fix, need to migrate to new API. http://crosbug.com/4321 |
622 OnUpdateCompleted(); | 624 OnUpdateCompleted(); |
623 } | 625 } |
624 | 626 |
625 void WizardController::EnableUserImageScreenReturnToPreviousHack() { | 627 void WizardController::EnableUserImageScreenReturnToPreviousHack() { |
626 user_image_screen_return_to_previous_hack_ = true; | 628 user_image_screen_return_to_previous_hack_ = true; |
627 } | 629 } |
628 | 630 |
631 void WizardController::OnEnrollmentAuthTokenReceived( | |
632 const std::string& token) { | |
633 // TODO(achuith, zork): This will be called via Bluetooth from a remote | |
634 // controller. | |
635 VLOG(1) << "OnEnrollmentAuthTokenReceived " << token; | |
636 if (ShouldAutoStartEnrollment() || ShouldRecoverEnrollment()) { | |
637 StartupUtils::MarkEulaAccepted(); | |
638 auth_token_ = token; | |
639 ShowAutoEnrollmentCheckScreen(); | |
dzhioev (left Google)
2014/09/09 01:35:41
Why not ShowEnrollmentScreen()?
Zachary Kuznia
2014/09/09 02:17:51
Misread the logic in OnUpdateCompleted(). Fixed.
| |
640 } else { | |
641 LOG(WARNING) << "Not in device enrollment."; | |
642 } | |
643 } | |
644 | |
629 void WizardController::OnUserImageSelected() { | 645 void WizardController::OnUserImageSelected() { |
630 if (user_image_screen_return_to_previous_hack_) { | 646 if (user_image_screen_return_to_previous_hack_) { |
631 user_image_screen_return_to_previous_hack_ = false; | 647 user_image_screen_return_to_previous_hack_ = false; |
632 DCHECK(previous_screen_); | 648 DCHECK(previous_screen_); |
633 if (previous_screen_) { | 649 if (previous_screen_) { |
634 SetCurrentScreen(previous_screen_); | 650 SetCurrentScreen(previous_screen_); |
635 return; | 651 return; |
636 } | 652 } |
637 } | 653 } |
638 if (!time_oobe_started_.is_null()) { | 654 if (!time_oobe_started_.is_null()) { |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1207 | 1223 |
1208 bool WizardController::SetOnTimeZoneResolvedForTesting( | 1224 bool WizardController::SetOnTimeZoneResolvedForTesting( |
1209 const base::Closure& callback) { | 1225 const base::Closure& callback) { |
1210 if (timezone_resolved_) | 1226 if (timezone_resolved_) |
1211 return false; | 1227 return false; |
1212 | 1228 |
1213 on_timezone_resolved_for_testing_ = callback; | 1229 on_timezone_resolved_for_testing_ = callback; |
1214 return true; | 1230 return true; |
1215 } | 1231 } |
1216 | 1232 |
1217 void WizardController::OnEnrollmentAuthTokenReceived( | |
1218 const std::string& token) { | |
1219 // TODO(achuith, zork): This will be called via Bluetooth from a remote | |
1220 // controller. | |
1221 VLOG(1) << "OnEnrollmentAuthTokenReceived " << token; | |
1222 if (ShouldAutoStartEnrollment() || ShouldRecoverEnrollment()) { | |
1223 StartupUtils::MarkEulaAccepted(); | |
1224 auth_token_ = token; | |
1225 InitiateOOBEUpdate(); | |
1226 } else { | |
1227 LOG(WARNING) << "Not in device enrollment."; | |
1228 } | |
1229 } | |
1230 | |
1231 } // namespace chromeos | 1233 } // namespace chromeos |
OLD | NEW |