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