OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Account picker screen implementation. | 6 * @fileoverview Account picker screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('AccountPickerScreen', 'account-picker', function() { | 9 login.createScreen('AccountPickerScreen', 'account-picker', function() { |
10 /** | 10 /** |
11 * Maximum number of offline login failures before online login. | 11 * Maximum number of offline login failures before online login. |
12 * @type {number} | 12 * @type {number} |
13 * @const | 13 * @const |
14 */ | 14 */ |
15 var MAX_LOGIN_ATTEMPTS_IN_POD = 3; | 15 var MAX_LOGIN_ATTEMPTS_IN_POD = 3; |
16 /** | |
17 * Whether to preselect the first pod automatically on login screen. | |
18 * @type {boolean} | |
19 * @const | |
20 */ | |
21 var PRESELECT_FIRST_POD = true; | |
22 | 16 |
23 return { | 17 return { |
24 EXTERNAL_API: [ | 18 EXTERNAL_API: [ |
25 'loadUsers', | 19 'loadUsers', |
26 'runAppForTesting', | 20 'runAppForTesting', |
27 'setApps', | 21 'setApps', |
28 'setShouldShowApps', | 22 'setShouldShowApps', |
29 'showAppError', | 23 'showAppError', |
30 'updateUserImage', | 24 'updateUserImage', |
31 'setCapsLockState', | 25 'setCapsLockState', |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 }, | 109 }, |
116 | 110 |
117 /** | 111 /** |
118 * Event handler invoked when the page is shown and ready. | 112 * Event handler invoked when the page is shown and ready. |
119 */ | 113 */ |
120 onShow: function() { | 114 onShow: function() { |
121 if (!this.firstShown_) return; | 115 if (!this.firstShown_) return; |
122 this.firstShown_ = false; | 116 this.firstShown_ = false; |
123 | 117 |
124 // Ensure that login is actually visible. | 118 // Ensure that login is actually visible. |
125 window.webkitRequestAnimationFrame(function() { | 119 window.requestAnimationFrame(function() { |
126 chrome.send('accountPickerReady'); | 120 chrome.send('accountPickerReady'); |
127 chrome.send('loginVisible', ['account-picker']); | 121 chrome.send('loginVisible', ['account-picker']); |
128 }); | 122 }); |
129 }, | 123 }, |
130 | 124 |
131 /** | 125 /** |
132 * Event handler that is invoked just before the frame is hidden. | 126 * Event handler that is invoked just before the frame is hidden. |
133 */ | 127 */ |
134 onBeforeHide: function() { | 128 onBeforeHide: function() { |
135 chrome.send('loginUIStateChanged', ['account-picker', false]); | 129 chrome.send('loginUIStateChanged', ['account-picker', false]); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 * Updates the list of available keyboard layouts for a public session pod. | 307 * Updates the list of available keyboard layouts for a public session pod. |
314 * @param {string} userID The user ID of the public session | 308 * @param {string} userID The user ID of the public session |
315 * @param {!Object} list List of available keyboard layouts | 309 * @param {!Object} list List of available keyboard layouts |
316 */ | 310 */ |
317 setPublicSessionKeyboardLayouts: function(userID, list) { | 311 setPublicSessionKeyboardLayouts: function(userID, list) { |
318 $('pod-row').setPublicSessionKeyboardLayouts(userID, list); | 312 $('pod-row').setPublicSessionKeyboardLayouts(userID, list); |
319 } | 313 } |
320 }; | 314 }; |
321 }); | 315 }); |
322 | 316 |
OLD | NEW |