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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 SetCurrentScreenSmooth(new_current, false); | 950 SetCurrentScreenSmooth(new_current, false); |
951 } | 951 } |
952 | 952 |
953 void WizardController::ShowCurrentScreen() { | 953 void WizardController::ShowCurrentScreen() { |
954 // ShowCurrentScreen may get called by smooth_show_timer_ even after | 954 // ShowCurrentScreen may get called by smooth_show_timer_ even after |
955 // flow has been switched to sign in screen (ExistingUserController). | 955 // flow has been switched to sign in screen (ExistingUserController). |
956 if (!oobe_ui_) | 956 if (!oobe_ui_) |
957 return; | 957 return; |
958 | 958 |
959 // First remember how far have we reached so that we can resume if needed. | 959 // First remember how far have we reached so that we can resume if needed. |
960 if (is_out_of_box_ && IsResumableScreen(current_screen_->GetName())) | 960 if (is_out_of_box_ && IsResumableScreen(current_screen_->screen_id())) |
961 StartupUtils::SaveOobePendingScreen(current_screen_->GetName()); | 961 StartupUtils::SaveOobePendingScreen(current_screen_->screen_id()); |
962 | 962 |
963 smooth_show_timer_.Stop(); | 963 smooth_show_timer_.Stop(); |
964 | 964 |
965 for (auto& observer : observer_list_) | 965 for (auto& observer : observer_list_) |
966 observer.OnScreenChanged(current_screen_); | 966 observer.OnScreenChanged(current_screen_); |
967 | 967 |
968 current_screen_->Show(); | 968 current_screen_->Show(); |
969 } | 969 } |
970 | 970 |
971 void WizardController::SetCurrentScreenSmooth(BaseScreen* new_current, | 971 void WizardController::SetCurrentScreenSmooth(BaseScreen* new_current, |
972 bool use_smoothing) { | 972 bool use_smoothing) { |
973 if (current_screen_ == new_current || new_current == nullptr || | 973 if (current_screen_ == new_current || new_current == nullptr || |
974 oobe_ui_ == nullptr) { | 974 oobe_ui_ == nullptr) { |
975 return; | 975 return; |
976 } | 976 } |
977 | 977 |
978 smooth_show_timer_.Stop(); | 978 smooth_show_timer_.Stop(); |
979 | 979 |
980 if (current_screen_) | 980 if (current_screen_) |
981 current_screen_->Hide(); | 981 current_screen_->Hide(); |
982 | 982 |
983 std::string screen_id = new_current->GetName(); | 983 std::string screen_id = new_current->screen_id(); |
984 if (IsOOBEStepToTrack(screen_id)) | 984 if (IsOOBEStepToTrack(screen_id)) |
985 screen_show_times_[screen_id] = base::Time::Now(); | 985 screen_show_times_[screen_id] = base::Time::Now(); |
986 | 986 |
987 previous_screen_ = current_screen_; | 987 previous_screen_ = current_screen_; |
988 current_screen_ = new_current; | 988 current_screen_ = new_current; |
989 | 989 |
990 if (use_smoothing) { | 990 if (use_smoothing) { |
991 smooth_show_timer_.Start( | 991 smooth_show_timer_.Start( |
992 FROM_HERE, | 992 FROM_HERE, |
993 base::TimeDelta::FromMilliseconds(kShowDelayMs), | 993 base::TimeDelta::FromMilliseconds(kShowDelayMs), |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 } | 1077 } |
1078 } | 1078 } |
1079 } | 1079 } |
1080 | 1080 |
1081 /////////////////////////////////////////////////////////////////////////////// | 1081 /////////////////////////////////////////////////////////////////////////////// |
1082 // WizardController, BaseScreenDelegate overrides: | 1082 // WizardController, BaseScreenDelegate overrides: |
1083 void WizardController::OnExit(BaseScreen& /* screen */, | 1083 void WizardController::OnExit(BaseScreen& /* screen */, |
1084 ExitCodes exit_code, | 1084 ExitCodes exit_code, |
1085 const ::login::ScreenContext* /* context */) { | 1085 const ::login::ScreenContext* /* context */) { |
1086 VLOG(1) << "Wizard screen exit code: " << exit_code; | 1086 VLOG(1) << "Wizard screen exit code: " << exit_code; |
1087 std::string previous_screen_id = current_screen_->GetName(); | 1087 std::string previous_screen_id = current_screen_->screen_id(); |
1088 if (IsOOBEStepToTrack(previous_screen_id)) { | 1088 if (IsOOBEStepToTrack(previous_screen_id)) { |
1089 RecordUMAHistogramForOOBEStepCompletionTime( | 1089 RecordUMAHistogramForOOBEStepCompletionTime( |
1090 previous_screen_id, | 1090 previous_screen_id, |
1091 base::Time::Now() - screen_show_times_[previous_screen_id]); | 1091 base::Time::Now() - screen_show_times_[previous_screen_id]); |
1092 } | 1092 } |
1093 switch (exit_code) { | 1093 switch (exit_code) { |
1094 case HID_DETECTION_COMPLETED: | 1094 case HID_DETECTION_COMPLETED: |
1095 OnHIDDetectionCompleted(); | 1095 OnHIDDetectionCompleted(); |
1096 break; | 1096 break; |
1097 case NETWORK_CONNECTED: | 1097 case NETWORK_CONNECTED: |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1500 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
1501 } | 1501 } |
1502 | 1502 |
1503 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1503 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
1504 screen->SetParameters(effective_config, shark_controller_.get()); | 1504 screen->SetParameters(effective_config, shark_controller_.get()); |
1505 SetStatusAreaVisible(true); | 1505 SetStatusAreaVisible(true); |
1506 SetCurrentScreen(screen); | 1506 SetCurrentScreen(screen); |
1507 } | 1507 } |
1508 | 1508 |
1509 } // namespace chromeos | 1509 } // namespace chromeos |
OLD | NEW |