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

Unified Diff: chrome/browser/resources/kiosk_mode_logout_dialog.js

Issue 9265026: Implement restart on Idle for Kiosk Mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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/kiosk_mode_logout_dialog.js
diff --git a/chrome/browser/resources/kiosk_mode_logout_dialog.js b/chrome/browser/resources/kiosk_mode_logout_dialog.js
new file mode 100644
index 0000000000000000000000000000000000000000..814d4314f5c997511c8db29bef8f89e59d01915d
--- /dev/null
+++ b/chrome/browser/resources/kiosk_mode_logout_dialog.js
@@ -0,0 +1,35 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('kioskModeLogoutDialog', function() {
+ 'use strict';
+ var timeToRestart = 20; // seconds
+ var warningText = '';
+
+ function decrementTimer(time) {
+ if (timeToRestart > 0) {
+ timeToRestart -= 1;
xiyuan 2012/01/20 18:23:44 nit: --timeToRestart
rkc 2012/01/26 03:37:23 Done.
+ $('warning').innerHTML = warningText + ' ' + timeToRestart + 's';
xiyuan 2012/01/20 18:23:44 Use LocalStrings.getStringF instead of string conc
rkc 2012/01/26 03:37:23 Done.
+ setTimeout(decrementTimer, 1000);
+ } else {
+ chrome.send('requestRestart');
+ }
+ }
+
+ /**
+ * Inserts translated strings on loading.
+ */
+ function initialize() {
+ i18nTemplate.process(document, templateData);
+ warningText = $('warning').innerHTML;
+ $('warning').innerHTML = warningText + ' ' + timeToRestart + 's';
flackr 2012/01/20 16:16:58 Use template parameter to insert timeToRestart usi
rkc 2012/01/26 03:37:23 Done.
+ setTimeout(decrementTimer, 1000);
+ }
+
+ return {
+ initialize: initialize,
+ };
+});
+
+document.addEventListener('DOMContentLoaded', kioskModeLogoutDialog.initialize);

Powered by Google App Engine
This is Rietveld 408576698