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

Side by Side Diff: chrome/browser/resources/chromeos/idle_logout_dialog.js

Issue 9568038: Implement the auto-logout on idle feature for Kiosk mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes. Created 8 years, 9 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 var timeToRestart;
6 var localStrings;
7 var countdownTimer;
8
9 /**
10 * Decrements the countdown timer and updates the display on the dialog.
11 */
12 function decrementTimer() {
13 if (timeToRestart >= 0) {
14 $('warning').innerHTML = localStrings.getStringF('warning',
arv (Not doing code reviews) 2012/03/02 00:15:33 Why innerHTML instead of textContent? Why is this
rkc 2012/03/02 01:20:56 Because we need to keep updating the text. Also, s
15 timeToRestart);
16 --timeToRestart;
arv (Not doing code reviews) 2012/03/02 00:15:33 prefer post decr in js
arv (Not doing code reviews) 2012/03/02 00:15:33 This does not seem quite right. How about checking
rkc 2012/03/02 01:20:56 Done.
rkc 2012/03/02 01:20:56 This code is no longer there. Done.
17 } else {
18 clearInterval(countdownTimer);
19 chrome.send('requestLogout');
20 }
21 }
22
23 function startCountdown(seconds) {
24 timeToRestart = seconds;
25 countdownTimer = setInterval(decrementTimer, 1000);
26 }
27
28 /**
29 * Inserts translated strings on loading.
30 */
31 function initialize() {
32 localStrings = new LocalStrings();
33
34 i18nTemplate.process(document, templateData);
35 chrome.send('requestCountdown');
36 }
37
38 document.addEventListener('DOMContentLoaded', initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698