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

Unified Diff: chrome/browser/resources/chromeos/login/oobe.js

Issue 10389064: Added estimated time remaining on AU. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed license headers. Created 8 years, 7 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/resources/chromeos/login/oobe.js
diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js
index 8c0ca09bbc4cc7b62addd39f6571302b3d865603..1b16c4df87af3399e368b47e1ad68e5aeaf0e1b7 100644
--- a/chrome/browser/resources/chromeos/login/oobe.js
+++ b/chrome/browser/resources/chromeos/login/oobe.js
@@ -151,6 +151,45 @@ cr.define('cr.ui', function() {
};
/**
+ * Sets estimated time left until download will complete.
+ * @param {number} days Number of estimated days.
+ * @param {number} hours Number of estimated hours.
+ * @param {number} minutes Number of estimated minutes.
+ * @param {number} seconds Number of estimated seconds.
+ */
+ Oobe.setUpdateEstimatedTimeLeft = function(days, hours, minutes, seconds) {
+ var units = ['days', 'hours', 'minutes', 'seconds'];
Nikita (slow) 2012/05/10 16:04:31 These should be loaded from localizedStrings.
+ var values = [days, hours, minutes, seconds];
+ var unit = 0;
+ while (units[unit + 1] && values[unit] == 0)
+ ++unit;
+
+ var text;
+ if (!units[unit + 1] || values[unit] == 0) {
Nikita (slow) 2012/05/10 16:04:31 Bad localization pattern. String format itself sho
+ text = values[unit] + ' ' + units[unit];
+ } else {
+ text = values[unit] + ' ' + units[unit] + ', ' +
+ values[unit + 1] + ' ' + units[unit + 1];
+ }
+ $('update-estimated-time-left').innerText = text;
+ };
+
+ /**
+ * Sets update's dowloading rate.
+ * @param {number} dowloading rate in bytes/sec.
+ */
+ Oobe.setUpdateDownloadingRate = function(rate) {
+ var units = ['B/s', 'kB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s'];
Nikita (slow) 2012/05/10 16:04:31 If we end up showing this to user than these shoul
+ var unit = 0;
+ while (units[unit + 1] && rate >= 999) {
+ rate /= 1024;
+ ++unit;
+ }
+ var text = Math.round(rate) + ' ' + units[unit];
+ $('update-downloading-rate').innerText = text;
+ };
+
+ /**
* Sets update message, which is shown above the progress bar.
* @param {text} message Message which is shown by the label.
*/
@@ -168,6 +207,14 @@ cr.define('cr.ui', function() {
};
/**
+ * Shows or hides update downloading stats.
+ * @param {boolean} enable Are stats shown?
+ */
+ Oobe.showUpdateDownloadingStats = function(enable) {
+ $('update-downloading-stats').hidden = !enable;
+ };
+
+ /**
* Sets TPM password.
* @param {text} password TPM password to be shown.
*/

Powered by Google App Engine
This is Rietveld 408576698