Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Unified Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 275913004: Add a pref to track progress of OOBE and resume if needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to tot. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 782236cc53f948940b254edd9723f03e85269532..0df78c6470529b11088a766c6254ad5f675d315d 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_ = screen_pref;
+ }
+
+ AdvanceToScreen(first_screen_name_);
if (!IsMachineHWIDCorrect() && !StartupUtils::IsDeviceRegistered() &&
- first_screen_name.empty())
+ first_screen_name_.empty())
ShowWrongHWIDScreen();
}
@@ -722,6 +746,10 @@ void WizardController::ShowCurrentScreen() {
if (!oobe_display_)
return;
+ // First remember how far have we reached so that we can resume if needed.
+ if (is_out_of_box_ && IsResumableScreen(current_screen_->GetName()))
+ StartupUtils::SaveOobePendingScreen(current_screen_->GetName());
+
smooth_show_timer_.Stop();
FOR_EACH_OBSERVER(Observer, observer_list_, OnScreenChanged(current_screen_));
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | chrome/browser/chromeos/login/wizard_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698