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

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

Issue 7057055: Show progress bar as soon as update state changed to UPDATE_STATUS_UPDATE_AVAILABLE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed test again Created 9 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/login/update_screen.h ('k') | chrome/browser/chromeos/login/update_screen_actor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/update_screen.cc
diff --git a/chrome/browser/chromeos/login/update_screen.cc b/chrome/browser/chromeos/login/update_screen.cc
index 7d04b0269a85853cc949449627ff5b9cf459b767..f1dc23c3ea4ba72de467beb881409cc939aec13c 100644
--- a/chrome/browser/chromeos/login/update_screen.cc
+++ b/chrome/browser/chromeos/login/update_screen.cc
@@ -40,10 +40,13 @@ const char kUpdateDeadlineFile[] = "/tmp/update-check-response-deadline";
void StartUpdateCallback(void* user_data,
UpdateResult result,
const char* msg) {
- if (result != chromeos::UPDATE_RESULT_SUCCESS) {
- DCHECK(user_data);
- UpdateScreen* screen = static_cast<UpdateScreen*>(user_data);
- if (UpdateScreen::HasInstance(screen))
+ VLOG(1) << "Callback from RequestUpdateCheck, result " << result;
+ DCHECK(user_data);
+ UpdateScreen* screen = static_cast<UpdateScreen*>(user_data);
+ if (UpdateScreen::HasInstance(screen)) {
+ if (result == chromeos::UPDATE_RESULT_SUCCESS)
+ screen->SetIgnoreIdleStatus(false);
+ else
screen->ExitUpdate(UpdateScreen::REASON_UPDATE_INIT_FAILED);
}
}
@@ -64,7 +67,6 @@ bool UpdateScreen::HasInstance(UpdateScreen* inst) {
return (found != instance_set.end());
}
-
UpdateScreen::UpdateScreen(ScreenObserver* screen_observer,
UpdateScreenActor* actor)
: WizardScreen(screen_observer),
@@ -73,6 +75,7 @@ UpdateScreen::UpdateScreen(ScreenObserver* screen_observer,
is_downloading_update_(false),
is_ignore_update_deadlines_(false),
is_shown_(false),
+ ignore_idle_status_(true),
actor_(actor) {
GetInstanceSet().insert(this);
}
@@ -87,6 +90,9 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
if (is_checking_for_update_ && status > UPDATE_STATUS_CHECKING_FOR_UPDATE) {
is_checking_for_update_ = false;
}
+ if (ignore_idle_status_ && status > UPDATE_STATUS_IDLE) {
+ ignore_idle_status_ = false;
+ }
switch (status) {
case UPDATE_STATUS_CHECKING_FOR_UPDATE:
@@ -103,6 +109,8 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
} else {
LOG(INFO) << "Critical update available: "
<< library->status().new_version;
+ actor_->ShowPreparingUpdatesInfo(true);
+ actor_->ShowCurtain(false);
}
break;
case UPDATE_STATUS_DOWNLOADING:
@@ -119,9 +127,10 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
} else {
LOG(INFO) << "Critical update available: "
<< library->status().new_version;
+ actor_->ShowPreparingUpdatesInfo(false);
+ actor_->ShowCurtain(false);
}
}
- actor_->ShowCurtain(false);
int download_progress = static_cast<int>(
library->status().download_progress * kDownloadProgressIncrement);
actor_->SetProgress(kBeforeDownloadProgress + download_progress);
@@ -152,6 +161,12 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
}
break;
case UPDATE_STATUS_IDLE:
+ if (ignore_idle_status_) {
+ // It is first IDLE status that is sent before we initiated the check.
+ break;
+ }
+ // else no break
+
case UPDATE_STATUS_ERROR:
case UPDATE_STATUS_REPORTING_ERROR_EVENT:
ExitUpdate(REASON_UPDATE_ENDED);
@@ -255,6 +270,10 @@ void UpdateScreen::SetRebootCheckDelay(int seconds) {
reboot_check_delay_ = seconds;
}
+void UpdateScreen::SetIgnoreIdleStatus(bool ignore_idle_status) {
+ ignore_idle_status_ = ignore_idle_status;
+}
+
bool UpdateScreen::HasCriticalUpdate() {
if (is_ignore_update_deadlines_)
return true;
« no previous file with comments | « chrome/browser/chromeos/login/update_screen.h ('k') | chrome/browser/chromeos/login/update_screen_actor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698