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

Unified Diff: chrome/browser/ui/webui/chromeos/login/update_screen_handler.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: 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/ui/webui/chromeos/login/update_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/update_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/update_screen_handler.cc
index a810e5c8613b5189380ef0f4441131e19fec786c..30416a2d4973298eb40fe6e38b48629d2f7568b0 100644
--- a/chrome/browser/ui/webui/chromeos/login/update_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/update_screen_handler.cc
@@ -45,6 +45,8 @@ void UpdateScreenHandler::GetLocalizedStrings(
l10n_util::GetStringUTF16(IDS_CHECKING_FOR_UPDATES));
localized_strings->SetString("installingUpdateDesc",
l10n_util::GetStringFUTF16(IDS_UPDATE_MSG, short_product_name));
+ localized_strings->SetString("downloading",
+ l10n_util::GetStringUTF16(IDS_DOWNLOADING));
localized_strings->SetString("downloadingTimeLeftLong",
l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_LONG));
localized_strings->SetString("downloadingTimeLeftStatusOneHour",
@@ -103,33 +105,54 @@ void UpdateScreenHandler::SetProgress(int progress) {
void UpdateScreenHandler::ShowEstimatedTimeLeft(bool enable) {
base::FundamentalValue enable_value(enable);
web_ui()->CallJavascriptFunction(
- "cr.ui.Oobe.showUpdateEstimatedTimeLeft", enable_value);
+ "cr.ui.Oobe.showEstimatedTimeLeft", enable_value);
}
void UpdateScreenHandler::SetEstimatedTimeLeft(const base::TimeDelta& time) {
base::FundamentalValue seconds_value(time.InSecondsF());
web_ui()->CallJavascriptFunction(
- "cr.ui.Oobe.setUpdateEstimatedTimeLeft", seconds_value);
+ "cr.ui.Oobe.setEstimatedTimeLeft", seconds_value);
}
-void UpdateScreenHandler::ShowCurtain(bool enable) {
+void UpdateScreenHandler::ShowProgressMessage(bool enable) {
base::FundamentalValue enable_value(enable);
web_ui()->CallJavascriptFunction(
- "cr.ui.Oobe.showUpdateCurtain", enable_value);
+ "cr.ui.Oobe.showProgressMessage", enable_value);
+}
+
+void UpdateScreenHandler::SetProgressMessage(ProgressMessage message) {
+ scoped_ptr<StringValue> progress_message;
+ switch (message) {
+ case PROGRESS_MESSAGE_UPDATE_AVAILABLE:
+ progress_message.reset(Value::CreateStringValue(
+ l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE)));
+ break;
+ case PROGRESS_MESSAGE_INSTALLING_UPDATE:
+ progress_message.reset(Value::CreateStringValue(
+ l10n_util::GetStringFUTF16(IDS_INSTALLING_UPDATE,
+ l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))));
+ break;
+ case PROGRESS_MESSAGE_VERIFYING:
+ progress_message.reset(Value::CreateStringValue(
+ l10n_util::GetStringUTF16(IDS_UPDATE_VERIFYING)));
+ break;
+ case PROGRESS_MESSAGE_FINALIZING:
+ progress_message.reset(Value::CreateStringValue(
+ l10n_util::GetStringUTF16(IDS_UPDATE_FINALIZING)));
+ break;
+ default:
+ NOTREACHED();
+ };
+ if (progress_message.get()) {
+ web_ui()->CallJavascriptFunction(
+ "cr.ui.Oobe.setProgressMessage", *progress_message);
+ }
}
-void UpdateScreenHandler::ShowPreparingUpdatesInfo(bool visible) {
- scoped_ptr<StringValue> info_message;
- if (visible) {
- info_message.reset(Value::CreateStringValue(
- l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE)));
- } else {
- info_message.reset(Value::CreateStringValue(
- l10n_util::GetStringFUTF16(IDS_INSTALLING_UPDATE,
- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))));
- }
- web_ui()->CallJavascriptFunction("cr.ui.Oobe.setUpdateMessage",
- *info_message);
+void UpdateScreenHandler::ShowCurtain(bool enable) {
+ base::FundamentalValue enable_value(enable);
+ web_ui()->CallJavascriptFunction(
+ "cr.ui.Oobe.showUpdateCurtain", enable_value);
}
void UpdateScreenHandler::RegisterMessages() {

Powered by Google App Engine
This is Rietveld 408576698