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

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: 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/update_screen_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..63553797cd8c39922935a3cd3c2deaad3c15b246 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",
@@ -100,36 +102,57 @@ void UpdateScreenHandler::SetProgress(int progress) {
progress_value);
}
-void UpdateScreenHandler::ShowEstimatedTimeLeft(bool enable) {
- base::FundamentalValue enable_value(enable);
+void UpdateScreenHandler::ShowEstimatedTimeLeft(bool visible) {
+ base::FundamentalValue visible_value(visible);
web_ui()->CallJavascriptFunction(
- "cr.ui.Oobe.showUpdateEstimatedTimeLeft", enable_value);
+ "cr.ui.Oobe.showEstimatedTimeLeft", visible_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) {
- base::FundamentalValue enable_value(enable);
+void UpdateScreenHandler::ShowProgressMessage(bool visible) {
+ base::FundamentalValue visible_value(visible);
web_ui()->CallJavascriptFunction(
- "cr.ui.Oobe.showUpdateCurtain", enable_value);
-}
-
-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))));
+ "cr.ui.Oobe.showProgressMessage", visible_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);
}
- web_ui()->CallJavascriptFunction("cr.ui.Oobe.setUpdateMessage",
- *info_message);
+}
+
+void UpdateScreenHandler::ShowCurtain(bool visible) {
+ base::FundamentalValue visible_value(visible);
+ web_ui()->CallJavascriptFunction(
+ "cr.ui.Oobe.showUpdateCurtain", visible_value);
}
void UpdateScreenHandler::RegisterMessages() {
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/update_screen_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698