diff options
author | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 14:27:09 +0000 |
---|---|---|
committer | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 14:27:09 +0000 |
commit | 268f64bdabe6917c676f04fe1401bca55804af1b (patch) | |
tree | 4af465cf439aef4285e157ccaa583509ce4a2fa1 /chrome/browser | |
parent | 6ec98f7fcbf1bcbbf41eacefcbb2051a4c0f69a5 (diff) | |
download | chromium_src-268f64bdabe6917c676f04fe1401bca55804af1b.zip chromium_src-268f64bdabe6917c676f04fe1401bca55804af1b.tar.gz chromium_src-268f64bdabe6917c676f04fe1401bca55804af1b.tar.bz2 |
Mark device registered for users who updated image
and thus never observed register device screen.
BUG=chromium-os:6289
TEST=Delete .oobe_completed file, reboot, OOBE progress bar shouldn't be visible if any user presents on login-screen.
Review URL: http://codereview.chromium.org/3325001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58168 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/chromeos/login/wizard_controller.cc | 32 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/wizard_controller.h | 12 |
2 files changed, 29 insertions, 15 deletions
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index a5b964e..82faecd 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -701,6 +701,12 @@ void WizardController::ShowFirstScreen(const std::string& first_screen_name) { } } +// static +bool WizardController::IsOobeCompleted() { + return g_browser_process->local_state()->GetBoolean(kOobeComplete); +} + +// static void WizardController::MarkOobeCompleted() { PrefService* prefs = g_browser_process->local_state(); prefs->SetBoolean(kOobeComplete, true); @@ -708,6 +714,13 @@ void WizardController::MarkOobeCompleted() { prefs->SavePersistentPrefs(); } +// static +bool WizardController::IsDeviceRegistered() { + FilePath oobe_complete_flag_file_path(kOobeCompleteFlagFilePath); + return file_util::PathExists(oobe_complete_flag_file_path); +} + +// static void WizardController::MarkDeviceRegistered() { // Create flag file for boot-time init scripts. FilePath oobe_complete_path(kOobeCompleteFlagFilePath); @@ -786,15 +799,6 @@ chromeos::ScreenObserver* WizardController::GetObserver(WizardScreen* screen) { return observer_ ? observer_ : this; } -bool WizardController::IsOobeCompleted() { - return g_browser_process->local_state()->GetBoolean(kOobeComplete); -} - -bool WizardController::IsDeviceRegistered() { - FilePath oobe_complete_flag_file_path(kOobeCompleteFlagFilePath); - return file_util::PathExists(oobe_complete_flag_file_path); -} - namespace browser { // Declared in browser_dialogs.h so that others don't need to depend on our .h. @@ -833,6 +837,16 @@ void ShowLoginWizard(const std::string& first_screen_name, switches::kEnableLoginImages)) { std::vector<chromeos::UserManager::User> users = chromeos::UserManager::Get()->GetUsers(); + + // Fix for users who updated device and thus never passed register screen. + // If we already have user we assume that it is not a second part of OOBE. + // See http://corbug.com/6289 + if (!WizardController::IsDeviceRegistered() && !users.empty()) { + LOG(INFO) << "Mark device registered because there are remembered users: " + << users.size(); + WizardController::MarkDeviceRegistered(); + } + // ExistingUserController deletes itself. (new chromeos::ExistingUserController(users, screen_bounds))->Init(); diff --git a/chrome/browser/chromeos/login/wizard_controller.h b/chrome/browser/chromeos/login/wizard_controller.h index e6750d4..1b82761 100644 --- a/chrome/browser/chromeos/login/wizard_controller.h +++ b/chrome/browser/chromeos/login/wizard_controller.h @@ -58,9 +58,15 @@ class WizardController : public chromeos::ScreenObserver, // Returns OOBE completion status. static bool IsOobeCompleted(); + // Marks OOBE process as completed. + static void MarkOobeCompleted(); + // Returns device registration completion status, i.e. second part of OOBE. static bool IsDeviceRegistered(); + // Marks device registered. i.e. second part of OOBE is completed. + static void MarkDeviceRegistered(); + // Shows the first screen defined by |first_screen_name| or by default // if the parameter is empty. |screen_bounds| are used to calculate position // of the wizard screen. @@ -171,12 +177,6 @@ class WizardController : public chromeos::ScreenObserver, // sets it as the current one. void ShowFirstScreen(const std::string& first_screen_name); - // Marks OOBE process as completed. - void MarkOobeCompleted(); - - // Marks device registered. i.e. second part of OOBE is completed. - void MarkDeviceRegistered(); - // Logs in the specified user via default login screen. void Login(const std::string& username, const std::string& password); |