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

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

Issue 10882014: Slightly modified ETA computation algorithm. Also modified UI of the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix, synx. Created 8 years, 4 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/update_screen.cc
diff --git a/chrome/browser/chromeos/login/update_screen.cc b/chrome/browser/chromeos/login/update_screen.cc
index 99f90324909d9dee86684283fb2d84065f926a99..2c57c0b2b549b56575539d75034be5e61e4e1f84 100644
--- a/chrome/browser/chromeos/login/update_screen.cc
+++ b/chrome/browser/chromeos/login/update_screen.cc
@@ -50,7 +50,8 @@ const double kMinProgressStep = 1e-3;
// Smooth factor that is used for the average downloading speed
// estimation.
-const double kDownloadSpeedSmoothFactor = 0.005;
+// avg_speed = smooth_factor * cur_speed + (1.0 - smooth_factor) * avg_speed.
+const double kDownloadSpeedSmoothFactor = 0.1;
// Minumum allowed value for the average downloading speed.
const double kDownloadAverageSpeedDropBound = 1e-8;
@@ -139,7 +140,9 @@ void UpdateScreen::UpdateStatusChanged(
} else {
LOG(INFO) << "Critical update available: "
<< status.new_version;
- actor_->ShowPreparingUpdatesInfo(true);
+ actor_->SetProgressMessage(
+ UpdateScreenActor::PROGRESS_MESSAGE_UPDATE_AVAILABLE);
+ actor_->ShowProgressMessage(true);
actor_->ShowCurtain(false);
}
break;
@@ -162,7 +165,9 @@ void UpdateScreen::UpdateStatusChanged(
} else {
LOG(INFO) << "Critical update available: "
<< status.new_version;
- actor_->ShowPreparingUpdatesInfo(false);
+ actor_->SetProgressMessage(
+ UpdateScreenActor::PROGRESS_MESSAGE_INSTALLING_UPDATE);
+ actor_->ShowProgressMessage(true);
actor_->ShowCurtain(false);
}
}
@@ -172,12 +177,15 @@ void UpdateScreen::UpdateStatusChanged(
case UpdateEngineClient::UPDATE_STATUS_VERIFYING:
MakeSureScreenIsShown();
actor_->SetProgress(kBeforeVerifyingProgress);
- actor_->ShowEstimatedTimeLeft(false);
+ actor_->SetProgressMessage(UpdateScreenActor::PROGRESS_MESSAGE_VERIFYING);
+ actor_->ShowProgressMessage(true);
break;
case UpdateEngineClient::UPDATE_STATUS_FINALIZING:
MakeSureScreenIsShown();
actor_->SetProgress(kBeforeFinalizingProgress);
- actor_->ShowEstimatedTimeLeft(false);
+ actor_->SetProgressMessage(
+ UpdateScreenActor::PROGRESS_MESSAGE_FINALIZING);
+ actor_->ShowProgressMessage(true);
break;
case UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT:
MakeSureScreenIsShown();
@@ -321,9 +329,7 @@ void UpdateScreen::UpdateDownloadingStats(
if (!actor_)
return;
base::Time download_current_time = base::Time::Now();
- if (download_current_time >= download_last_time_ + kMinTimeStep &&
- status.download_progress >=
- download_last_progress_ + kMinProgressStep) {
+ if (download_current_time >= download_last_time_ + kMinTimeStep) {
// Estimate downloading rate.
double progress_delta =
std::max(status.download_progress - download_last_progress_, 0.0);
« no previous file with comments | « chrome/browser/chromeos/login/mock_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