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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 } // namespace | 108 } // namespace |
109 | 109 |
110 namespace chromeos { | 110 namespace chromeos { |
111 | 111 |
112 const char WizardController::kNetworkScreenName[] = "network"; | 112 const char WizardController::kNetworkScreenName[] = "network"; |
113 const char WizardController::kLoginScreenName[] = "login"; | 113 const char WizardController::kLoginScreenName[] = "login"; |
114 const char WizardController::kUpdateScreenName[] = "update"; | 114 const char WizardController::kUpdateScreenName[] = "update"; |
115 const char WizardController::kUserImageScreenName[] = "image"; | 115 const char WizardController::kUserImageScreenName[] = "image"; |
116 const char WizardController::kEulaScreenName[] = "eula"; | 116 const char WizardController::kEulaScreenName[] = "eula"; |
117 const char WizardController::kRegistrationScreenName[] = "register"; | |
118 const char WizardController::kEnterpriseEnrollmentScreenName[] = "enroll"; | 117 const char WizardController::kEnterpriseEnrollmentScreenName[] = "enroll"; |
119 const char WizardController::kResetScreenName[] = "reset"; | 118 const char WizardController::kResetScreenName[] = "reset"; |
120 const char WizardController::kErrorScreenName[] = "error-message"; | 119 const char WizardController::kErrorScreenName[] = "error-message"; |
121 const char WizardController::kTermsOfServiceScreenName[] = "tos"; | 120 const char WizardController::kTermsOfServiceScreenName[] = "tos"; |
122 const char WizardController::kWrongHWIDScreenName[] = "wrong-hwid"; | 121 const char WizardController::kWrongHWIDScreenName[] = "wrong-hwid"; |
123 const char WizardController::kLocallyManagedUserCreationScreenName[] = | 122 const char WizardController::kLocallyManagedUserCreationScreenName[] = |
124 "locally-managed-user-creation-flow"; | 123 "locally-managed-user-creation-flow"; |
125 | 124 |
126 // Passing this parameter as a "first screen" initiates full OOBE flow. | 125 // Passing this parameter as a "first screen" initiates full OOBE flow. |
127 const char WizardController::kOutOfBoxScreenName[] = "oobe"; | 126 const char WizardController::kOutOfBoxScreenName[] = "oobe"; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 base::Unretained(chromeos::LoginUtils::Get()), | 525 base::Unretained(chromeos::LoginUtils::Get()), |
527 ProfileManager::GetDefaultProfile(), host_)); | 526 ProfileManager::GetDefaultProfile(), host_)); |
528 host_ = NULL; | 527 host_ = NULL; |
529 // TODO(avayvod): Sync image with Google Sync. | 528 // TODO(avayvod): Sync image with Google Sync. |
530 } | 529 } |
531 | 530 |
532 void WizardController::OnUserImageSkipped() { | 531 void WizardController::OnUserImageSkipped() { |
533 OnUserImageSelected(); | 532 OnUserImageSelected(); |
534 } | 533 } |
535 | 534 |
536 void WizardController::OnRegistrationSuccess() { | |
537 MarkDeviceRegistered(); | |
538 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) { | |
539 std::string spec; | |
540 GURL start_url; | |
541 if (screen_parameters_.get() && | |
542 screen_parameters_->GetString("start_url", &spec)) { | |
543 start_url = GURL(spec); | |
544 } | |
545 chromeos::LoginUtils::Get()->CompleteOffTheRecordLogin(start_url); | |
546 } else { | |
547 ShowTermsOfServiceScreen(); | |
548 } | |
549 } | |
550 | |
551 void WizardController::OnEnterpriseEnrollmentDone() { | 535 void WizardController::OnEnterpriseEnrollmentDone() { |
552 ShowLoginScreen(); | 536 ShowLoginScreen(); |
553 } | 537 } |
554 | 538 |
555 void WizardController::OnResetCanceled() { | 539 void WizardController::OnResetCanceled() { |
556 if (previous_screen_) | 540 if (previous_screen_) |
557 SetCurrentScreen(previous_screen_); | 541 SetCurrentScreen(previous_screen_); |
558 else | 542 else |
559 ShowLoginScreen(); | 543 ShowLoginScreen(); |
560 } | 544 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 if (screen_name == kNetworkScreenName) { | 651 if (screen_name == kNetworkScreenName) { |
668 ShowNetworkScreen(); | 652 ShowNetworkScreen(); |
669 } else if (screen_name == kLoginScreenName) { | 653 } else if (screen_name == kLoginScreenName) { |
670 ShowLoginScreen(); | 654 ShowLoginScreen(); |
671 } else if (screen_name == kUpdateScreenName) { | 655 } else if (screen_name == kUpdateScreenName) { |
672 InitiateOOBEUpdate(); | 656 InitiateOOBEUpdate(); |
673 } else if (screen_name == kUserImageScreenName) { | 657 } else if (screen_name == kUserImageScreenName) { |
674 ShowUserImageScreen(); | 658 ShowUserImageScreen(); |
675 } else if (screen_name == kEulaScreenName) { | 659 } else if (screen_name == kEulaScreenName) { |
676 ShowEulaScreen(); | 660 ShowEulaScreen(); |
677 } else if (screen_name == kRegistrationScreenName) { | |
678 // Just proceed to next stage. | |
679 OnRegistrationSuccess(); | |
680 } else if (screen_name == kResetScreenName) { | 661 } else if (screen_name == kResetScreenName) { |
681 ShowResetScreen(); | 662 ShowResetScreen(); |
682 } else if (screen_name == kEnterpriseEnrollmentScreenName) { | 663 } else if (screen_name == kEnterpriseEnrollmentScreenName) { |
683 ShowEnterpriseEnrollmentScreen(); | 664 ShowEnterpriseEnrollmentScreen(); |
684 } else if (screen_name == kTermsOfServiceScreenName) { | 665 } else if (screen_name == kTermsOfServiceScreenName) { |
685 ShowTermsOfServiceScreen(); | 666 ShowTermsOfServiceScreen(); |
686 } else if (screen_name == kWrongHWIDScreenName) { | 667 } else if (screen_name == kWrongHWIDScreenName) { |
687 ShowWrongHWIDScreen(); | 668 ShowWrongHWIDScreen(); |
688 } else if (screen_name == kLocallyManagedUserCreationScreenName) { | 669 } else if (screen_name == kLocallyManagedUserCreationScreenName) { |
689 ShowLocallyManagedUserCreationScreen(); | 670 ShowLocallyManagedUserCreationScreen(); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 return zero_delay_enabled_; | 868 return zero_delay_enabled_; |
888 } | 869 } |
889 | 870 |
890 // static | 871 // static |
891 void WizardController::SetZeroDelays() { | 872 void WizardController::SetZeroDelays() { |
892 kShowDelayMs = 0; | 873 kShowDelayMs = 0; |
893 zero_delay_enabled_ = true; | 874 zero_delay_enabled_ = true; |
894 } | 875 } |
895 | 876 |
896 } // namespace chromeos | 877 } // namespace chromeos |
OLD | NEW |