diff options
author | denisromanov@chromium.org <denisromanov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 21:19:47 +0000 |
---|---|---|
committer | denisromanov@chromium.org <denisromanov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 21:19:47 +0000 |
commit | 27ed3baee75f2dd28eb837dafdb41c5bddc759cd (patch) | |
tree | 8aad8ca3d9159693ae93e72681acbfb8b5a75003 /chrome/browser | |
parent | 7c03692a1fce73101c9943549419c4bc3da38afc (diff) | |
download | chromium_src-27ed3baee75f2dd28eb837dafdb41c5bddc759cd.zip chromium_src-27ed3baee75f2dd28eb837dafdb41c5bddc759cd.tar.gz chromium_src-27ed3baee75f2dd28eb837dafdb41c5bddc759cd.tar.bz2 |
Changed update screen logic.
Any error during checking for update or updating returned OOBE wizard to network selection screen.
Now error checking for update causes the OOBE wizard to proceed to the login screen, and error updating - to the network selection screen.
BUG=cros:3676
TEST=Try to reproduce bug http://crosbug.com/3676. It should not reproduce.
Review URL: http://codereview.chromium.org/2470002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
6 files changed, 32 insertions, 17 deletions
diff --git a/chrome/browser/chromeos/login/screen_observer.h b/chrome/browser/chromeos/login/screen_observer.h index fd4bded..bf7650d 100644 --- a/chrome/browser/chromeos/login/screen_observer.h +++ b/chrome/browser/chromeos/login/screen_observer.h @@ -29,8 +29,8 @@ class ScreenObserver { CONNECTION_FAILED, UPDATE_INSTALLED, UPDATE_NOUPDATE, - UPDATE_NETWORK_ERROR, - UPDATE_OTHER_ERROR, + UPDATE_ERROR_CHECKING_FOR_UPDATE, + UPDATE_ERROR_UPDATING, EXIT_CODES_COUNT // not a real code, must be the last }; diff --git a/chrome/browser/chromeos/login/update_screen.cc b/chrome/browser/chromeos/login/update_screen.cc index c664082..2b3a2ba 100644 --- a/chrome/browser/chromeos/login/update_screen.cc +++ b/chrome/browser/chromeos/login/update_screen.cc @@ -23,7 +23,8 @@ namespace chromeos { UpdateScreen::UpdateScreen(WizardScreenDelegate* delegate) : DefaultViewScreen<chromeos::UpdateView>(delegate), update_result_(UPGRADE_STARTED), - update_error_(GOOGLE_UPDATE_NO_ERROR) { + update_error_(GOOGLE_UPDATE_NO_ERROR), + checking_for_update_(true) { } UpdateScreen::~UpdateScreen() { @@ -37,8 +38,8 @@ UpdateScreen::~UpdateScreen() { } void UpdateScreen::OnReportResults(GoogleUpdateUpgradeResult result, - GoogleUpdateErrorCode error_code, - const std::wstring& version) { + GoogleUpdateErrorCode error_code, + const std::wstring& version) { // Drop the last reference to the object so that it gets cleaned up here. google_updater_ = NULL; // Depending on the result decide what to do next. @@ -46,6 +47,7 @@ void UpdateScreen::OnReportResults(GoogleUpdateUpgradeResult result, update_error_ = error_code; switch (update_result_) { case UPGRADE_IS_AVAILABLE: + checking_for_update_ = false; // Advance view progress bar. view()->AddProgress(kUpdateCheckProgressIncrement); // Create new Google Updater instance and install the update. @@ -57,6 +59,7 @@ void UpdateScreen::OnReportResults(GoogleUpdateUpgradeResult result, view()->AddProgress(kUpdateCompleteProgressIncrement); // Fall through. case UPGRADE_ALREADY_UP_TO_DATE: + checking_for_update_ = false; view()->AddProgress(kUpdateCheckProgressIncrement); // Fall through. case UPGRADE_ERROR: @@ -81,6 +84,7 @@ void UpdateScreen::StartUpdate() { &UpdateScreen::OnMinimalUpdateTimeElapsed); // Create Google Updater object and check if there is an update available. + checking_for_update_ = true; google_updater_ = CreateGoogleUpdate(); google_updater_->set_status_listener(this); google_updater_->CheckForUpdate(false, NULL); @@ -106,12 +110,10 @@ void UpdateScreen::ExitUpdate() { observer->OnExit(ScreenObserver::UPDATE_INSTALLED); break; case UPGRADE_ERROR: - if (update_error_ == GOOGLE_UPDATE_ERROR_UPDATING) { - observer->OnExit(ScreenObserver::UPDATE_NETWORK_ERROR); + if (checking_for_update_) { + observer->OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE); } else { - // TODO(denisromanov): figure out better what to do if - // some other error has occurred. - observer->OnExit(ScreenObserver::UPDATE_OTHER_ERROR); + observer->OnExit(ScreenObserver::UPDATE_ERROR_UPDATING); } break; default: diff --git a/chrome/browser/chromeos/login/update_screen.h b/chrome/browser/chromeos/login/update_screen.h index 4f0d3a0..825a2b5 100644 --- a/chrome/browser/chromeos/login/update_screen.h +++ b/chrome/browser/chromeos/login/update_screen.h @@ -54,6 +54,7 @@ class UpdateScreen: public DefaultViewScreen<chromeos::UpdateView>, // Update status. GoogleUpdateUpgradeResult update_result_; GoogleUpdateErrorCode update_error_; + bool checking_for_update_; // Google Updater. scoped_refptr<GoogleUpdate> google_updater_; diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index b76f412..0b3f9d7 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -360,8 +360,16 @@ void WizardController::OnUpdateCompleted() { ShowLoginScreen(); } -void WizardController::OnUpdateNetworkError() { - // If network connection got interrupted while downloading the update, +void WizardController::OnUpdateErrorCheckingForUpdate() { + // We do not want to block users from being able to proceed to the login + // screen if there is any error checking for an update. + // They could use "browse without sign-in" feature to set up the network to be + // able to perform the update later. + ShowLoginScreen(); +} + +void WizardController::OnUpdateErrorUpdating() { + // If there was an error while getting or applying the update, // return to network selection screen. // TODO(nkostylev): Show message to the user explaining update error. ShowNetworkScreen(); @@ -438,9 +446,11 @@ void WizardController::OnExit(ExitCodes exit_code) { case UPDATE_NOUPDATE: OnUpdateCompleted(); break; - case UPDATE_NETWORK_ERROR: - case UPDATE_OTHER_ERROR: - OnUpdateNetworkError(); + case UPDATE_ERROR_CHECKING_FOR_UPDATE: + OnUpdateErrorCheckingForUpdate(); + break; + case UPDATE_ERROR_UPDATING: + OnUpdateErrorUpdating(); break; default: NOTREACHED(); diff --git a/chrome/browser/chromeos/login/wizard_controller.h b/chrome/browser/chromeos/login/wizard_controller.h index 25d3939..f78eb58 100644 --- a/chrome/browser/chromeos/login/wizard_controller.h +++ b/chrome/browser/chromeos/login/wizard_controller.h @@ -110,7 +110,8 @@ class WizardController : public chromeos::ScreenObserver, void OnAccountCreated(); void OnConnectionFailed(); void OnUpdateCompleted(); - void OnUpdateNetworkError(); + void OnUpdateErrorCheckingForUpdate(); + void OnUpdateErrorUpdating(); // Switches from one screen to another. void SetCurrentScreen(WizardScreen* screen); diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index e89a3ed..79e9362 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc @@ -162,7 +162,8 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowErrorUpdate) { EXPECT_CALL(*mock_update_screen_, Hide()).Times(1); EXPECT_CALL(*mock_network_screen_, Show()).Times(1); EXPECT_CALL(*mock_network_screen_, Hide()).Times(0); // last transition - controller()->OnExit(chromeos::ScreenObserver::UPDATE_NETWORK_ERROR); + controller()->OnExit( + chromeos::ScreenObserver::UPDATE_ERROR_UPDATING); EXPECT_EQ(controller()->GetNetworkScreen(), controller()->current_screen()); } |