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