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

Side by Side Diff: chrome/browser/resources/chromeos/retail_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: Review comments. Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('retailModeLogoutDialog', function() {
6 'use strict';
7 var timeToRestart = 20; // seconds
8 var localStrings;
9 var countdownTimer = -1;
flackr 2012/02/08 21:23:44 nit: leave value undefined.
10
11 /**
12 * Decrements the countdown timer and updates the display on the dialog.
13 */
14 function decrementTimer() {
15 if (timeToRestart > 0) {
16 --timeToRestart;
17 $('warning').innerHTML = localStrings.getStringF('warning',
18 timeToRestart);
19 } else {
20 clearInterval(countdownTimer);
21 chrome.send('requestRestart');
22 }
23 }
24
25 /**
26 * Inserts translated strings on loading.
27 */
28 function initialize() {
29 localStrings = new LocalStrings();
30
31 i18nTemplate.process(document, templateData);
32
33 $('warning').innerHTML = localStrings.getStringF('warning', timeToRestart);
34 countdownTimer = setInterval(decrementTimer, 1000);
35 }
36
37 return {
38 initialize: initialize,
39 };
40 });
41
42 document.addEventListener('DOMContentLoaded',
43 retailModeLogoutDialog.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698