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 /** |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 error, | 217 error, |
218 BUBBLE_OFFSET, BUBBLE_PADDING); | 218 BUBBLE_OFFSET, BUBBLE_PADDING); |
219 }; | 219 }; |
220 activatedPod.addEventListener("webkitTransitionEnd", showTopCallback); | 220 activatedPod.addEventListener("webkitTransitionEnd", showTopCallback); |
221 ensureTransitionEndEvent(activatedPod); | 221 ensureTransitionEndEvent(activatedPod); |
222 } | 222 } |
223 } | 223 } |
224 }, | 224 }, |
225 | 225 |
226 /** | 226 /** |
227 * Loads the PIN keyboard if any of the users can login with a PIN. | 227 * Loads the PIN keyboard if any of the users can login with a PIN. Disables |
| 228 * the PIN keyboard for users who are not allowed to use PIN unlock. |
228 * @param {array} users Array of user instances. | 229 * @param {array} users Array of user instances. |
229 */ | 230 */ |
230 loadPinKeyboardIfNeeded_: function(users) { | 231 initializePinKeyboardStateForUsers_: function(users) { |
231 for (var i = 0; i < users.length; ++i) { | 232 for (var i = 0; i < users.length; ++i) { |
232 var user = users[i]; | 233 var user = users[i]; |
233 if (user.showPin) { | 234 if (user.showPin) { |
234 showPinKeyboardAsync(); | 235 showPinKeyboardAsync(); |
235 return; | 236 } else { |
| 237 // Disable pin for users who cannot authenticate with PIN. For |
| 238 // example, users who have not set up PIN or users who have not |
| 239 // entered their account recently. Otherwise, the PIN keyboard will |
| 240 // will appear for any user if there is at least one user who has PIN |
| 241 // enabled. |
| 242 this.disablePinKeyboardForUser(user.username); |
236 } | 243 } |
237 } | 244 } |
238 }, | 245 }, |
239 | 246 |
240 /** | 247 /** |
241 * Loads given users in pod row. | 248 * Loads given users in pod row. |
242 * @param {array} users Array of user. | 249 * @param {array} users Array of user. |
243 * @param {boolean} showGuest Whether to show guest session button. | 250 * @param {boolean} showGuest Whether to show guest session button. |
244 */ | 251 */ |
245 loadUsers: function(users, showGuest) { | 252 loadUsers: function(users, showGuest) { |
246 $('pod-row').loadPods(users); | 253 $('pod-row').loadPods(users); |
247 $('login-header-bar').showGuestButton = showGuest; | 254 $('login-header-bar').showGuestButton = showGuest; |
248 // On Desktop, #login-header-bar has a shadow if there are 8+ profiles. | 255 // On Desktop, #login-header-bar has a shadow if there are 8+ profiles. |
249 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) | 256 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) |
250 $('login-header-bar').classList.toggle('shadow', users.length > 8); | 257 $('login-header-bar').classList.toggle('shadow', users.length > 8); |
251 | 258 |
252 this.loadPinKeyboardIfNeeded_(users); | 259 this.initializePinKeyboardStateForUsers_(users); |
253 }, | 260 }, |
254 | 261 |
255 /** | 262 /** |
256 * Runs app with a given id from the list of loaded apps. | 263 * Runs app with a given id from the list of loaded apps. |
257 * @param {!string} app_id of an app to run. | 264 * @param {!string} app_id of an app to run. |
258 * @param {boolean=} opt_diagnostic_mode Whether to run the app in | 265 * @param {boolean=} opt_diagnostic_mode Whether to run the app in |
259 * diagnostic mode. Default is false. | 266 * diagnostic mode. Default is false. |
260 */ | 267 */ |
261 runAppForTesting: function(app_id, opt_diagnostic_mode) { | 268 runAppForTesting: function(app_id, opt_diagnostic_mode) { |
262 $('pod-row').findAndRunAppForTesting(app_id, opt_diagnostic_mode); | 269 $('pod-row').findAndRunAppForTesting(app_id, opt_diagnostic_mode); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 * @param {string} userID The user ID of the public session | 428 * @param {string} userID The user ID of the public session |
422 * @param {string} locale The locale to which this list of keyboard layouts | 429 * @param {string} locale The locale to which this list of keyboard layouts |
423 * applies | 430 * applies |
424 * @param {!Object} list List of available keyboard layouts | 431 * @param {!Object} list List of available keyboard layouts |
425 */ | 432 */ |
426 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 433 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
427 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 434 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
428 } | 435 } |
429 }; | 436 }; |
430 }); | 437 }); |
OLD | NEW |