Chromium Code Reviews| Index: chrome/browser/chromeos/login/wizard_controller.cc |
| diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc |
| index f2486d71f4d78838bff6e77084724b26bed56a37..c8b86f371fad4c235657e8599579b0d9f8737c5e 100644 |
| --- a/chrome/browser/chromeos/login/wizard_controller.cc |
| +++ b/chrome/browser/chromeos/login/wizard_controller.cc |
| @@ -86,12 +86,29 @@ static int kShowDelayMs = 400; |
| // Total timezone resolving process timeout. |
| const unsigned int kResolveTimeZoneTimeoutSeconds = 60; |
| +// Stores the list of all screens that should be shown when resuming OOBE. |
| +const char *kResumableScreens[] = { |
| + chromeos::WizardController::kNetworkScreenName, |
| + chromeos::WizardController::kUpdateScreenName, |
| + chromeos::WizardController::kEulaScreenName, |
| + chromeos::WizardController::kEnrollmentScreenName, |
| + chromeos::WizardController::kTermsOfServiceScreenName |
| +}; |
| + |
| // Checks flag for HID-detection screen show. |
| bool CanShowHIDDetectionScreen() { |
| return CommandLine::ForCurrentProcess()->HasSwitch( |
| chromeos::switches::kEnableHIDDetectionOnOOBE); |
| } |
| +bool IsResumableScreen(const std::string& screen) { |
| + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kResumableScreens); ++i) { |
| + if (screen == kResumableScreens[i]) |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| } // namespace |
| namespace chromeos { |
| @@ -209,9 +226,16 @@ void WizardController::Init( |
| } |
| } |
| - AdvanceToScreen(first_screen_name); |
| + const std::string screen_pref = |
| + GetLocalState()->GetString(prefs::kOobeScreenPending); |
| + if (is_out_of_box_ && !screen_pref.empty() && (first_screen_name.empty() || |
| + first_screen_name == WizardController::kTestNoScreenName)) { |
| + first_screen_name_ = GetLocalState()->GetString(prefs::kOobeScreenPending); |
|
Mattias Nissler (ping if slow)
2014/05/20 09:33:12
nit: no need to ask local_state again, just assign
pastarmovj
2014/05/20 13:57:01
Of course :) this was a branch messing artifact :)
|
| + } |
| + |
| + AdvanceToScreen(first_screen_name_); |
| if (!IsMachineHWIDCorrect() && !StartupUtils::IsDeviceRegistered() && |
| - first_screen_name.empty()) |
| + first_screen_name_.empty()) |
| ShowWrongHWIDScreen(); |
| } |
| @@ -713,6 +737,10 @@ void WizardController::PerformOOBECompletedActions() { |
| } |
| void WizardController::SetCurrentScreen(WizardScreen* new_current) { |
| + // First remember how far have we reached so that we can resume if needed. |
| + if (is_out_of_box_ && IsResumableScreen(new_current->GetName())) |
| + StartupUtils::SaveOobePendingScreen(new_current->GetName()); |
|
Mattias Nissler (ping if slow)
2014/05/20 09:33:12
Shouldn't this code be in SetCurrentScreenSmooth (
pastarmovj
2014/05/20 13:57:01
Done.
|
| + |
| SetCurrentScreenSmooth(new_current, false); |
| } |
| @@ -761,6 +789,10 @@ void WizardController::SetStatusAreaVisible(bool visible) { |
| } |
| void WizardController::AdvanceToScreen(const std::string& screen_name) { |
| + // First remember how far have we reached so that we can resume if needed. |
| + if (is_out_of_box_ && IsResumableScreen(screen_name)) |
| + StartupUtils::SaveOobePendingScreen(screen_name); |
|
Mattias Nissler (ping if slow)
2014/05/20 09:33:12
Isn't the code below going through SetCurrentScree
pastarmovj
2014/05/20 13:57:01
Done.
|
| + |
| if (screen_name == kNetworkScreenName) { |
| ShowNetworkScreen(); |
| } else if (screen_name == kLoginScreenName) { |