summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authororitm@chromium.org <oritm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 17:45:45 +0000
committeroritm@chromium.org <oritm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 17:45:45 +0000
commit99f2dd51fc1346bcb48d2a3e3f6720dea13136cc (patch)
tree9e9057dfb2acb259c96042f97f720f59aae92800
parent43f70a54f7816588764c3394f511a9ce955ca3fa (diff)
downloadchromium_src-99f2dd51fc1346bcb48d2a3e3f6720dea13136cc.zip
chromium_src-99f2dd51fc1346bcb48d2a3e3f6720dea13136cc.tar.gz
chromium_src-99f2dd51fc1346bcb48d2a3e3f6720dea13136cc.tar.bz2
Merge 48662 - 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 TBR=denisromanov@chromium.org Review URL: http://codereview.chromium.org/2563003 git-svn-id: svn://svn.chromium.org/chrome/branches/418/src@48846 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/login/screen_observer.h4
-rw-r--r--chrome/browser/chromeos/login/update_screen.cc18
-rw-r--r--chrome/browser/chromeos/login/update_screen.h1
-rw-r--r--chrome/browser/chromeos/login/wizard_controller.cc20
-rw-r--r--chrome/browser/chromeos/login/wizard_controller.h3
-rw-r--r--chrome/browser/chromeos/login/wizard_controller_browsertest.cc3
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 8c1f6e3..cfb7624 100644
--- a/chrome/browser/chromeos/login/screen_observer.h
+++ b/chrome/browser/chromeos/login/screen_observer.h
@@ -28,8 +28,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 41f244b..4d9125e 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -352,8 +352,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();
@@ -429,9 +437,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 f94749c..1b1e24b 100644
--- a/chrome/browser/chromeos/login/wizard_controller.h
+++ b/chrome/browser/chromeos/login/wizard_controller.h
@@ -102,7 +102,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 0a6fe57..e9247b0 100644
--- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc
+++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc
@@ -161,7 +161,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());
}