Chromium Code Reviews| 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 | |
| 9 login.createScreen('AccountPickerScreen', 'account-picker', function() { | 8 login.createScreen('AccountPickerScreen', 'account-picker', function() { |
|
jdufault
2016/06/17 18:54:22
Restore newline
sammiequon
2016/06/22 23:26:17
Done.
| |
| 10 /** | 9 /** |
| 11 * Maximum number of offline login failures before online login. | 10 * Maximum number of offline login failures before online login. |
| 12 * @type {number} | 11 * @type {number} |
| 13 * @const | 12 * @const |
| 14 */ | 13 */ |
| 15 var MAX_LOGIN_ATTEMPTS_IN_POD = 3; | 14 var MAX_LOGIN_ATTEMPTS_IN_POD = 3; |
| 16 | 15 |
| 17 return { | 16 return { |
| 18 EXTERNAL_API: [ | 17 EXTERNAL_API: [ |
| 19 'loadUsers', | 18 'loadUsers', |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 var maxHeight = | 187 var maxHeight = |
| 189 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); | 188 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); |
| 190 if (maxHeight < $('bubble').offsetHeight) { | 189 if (maxHeight < $('bubble').offsetHeight) { |
| 191 $('bubble').showContentForElement(activatedPod.mainInput, | 190 $('bubble').showContentForElement(activatedPod.mainInput, |
| 192 cr.ui.Bubble.Attachment.TOP, | 191 cr.ui.Bubble.Attachment.TOP, |
| 193 error, | 192 error, |
| 194 BUBBLE_OFFSET, BUBBLE_PADDING); | 193 BUBBLE_OFFSET, BUBBLE_PADDING); |
| 195 } | 194 } |
| 196 } | 195 } |
| 197 }, | 196 }, |
| 198 | |
| 199 /** | 197 /** |
|
jdufault
2016/06/17 18:54:23
Restore newline
sammiequon
2016/06/22 23:26:17
Done.
| |
| 200 * Loads the PIN keyboard if any of the users can login with a PIN. | 198 * Loads the PIN keyboard if any of the users can login with a PIN. |
| 201 * @param {array} users Array of user instances. | 199 * @param {array} users Array of user instances. |
| 202 */ | 200 */ |
| 203 loadPinKeyboardIfNeeded_: function(users) { | 201 loadPinKeyboardIfNeeded_: function(users) { |
| 204 for (var i = 0; i < users.length; ++i) { | 202 for (var i = 0; i < users.length; ++i) { |
| 205 var user = users[i]; | 203 var user = users[i]; |
| 206 if (user.showPin) { | 204 if (user.showPin) { |
| 207 showPinKeyboardAsync(); | 205 var pod = $('pod-row').getPodWithUsername(user.username); |
| 206 if(pod) | |
|
jdufault
2016/06/17 18:54:23
nit: if (
sammiequon
2016/06/22 23:26:17
Done.
| |
| 207 showPinKeyboardAsync(pod, true); | |
|
jdufault
2016/06/17 18:54:22
When is there going to be a username with showPin=
sammiequon
2016/06/22 23:26:17
Done.
| |
| 208 return; | 208 return; |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 }, | 211 }, |
| 212 | 212 |
| 213 /** | 213 /** |
| 214 * Loads given users in pod row. | 214 * Loads given users in pod row. |
| 215 * @param {array} users Array of user. | 215 * @param {array} users Array of user. |
| 216 * @param {boolean} showGuest Whether to show guest session button. | 216 * @param {boolean} showGuest Whether to show guest session button. |
| 217 */ | 217 */ |
| 218 loadUsers: function(users, showGuest) { | 218 loadUsers: function(users, showGuest) { |
| 219 $('pod-row').loadPods(users); | |
| 219 this.loadPinKeyboardIfNeeded_(users); | 220 this.loadPinKeyboardIfNeeded_(users); |
| 220 | 221 |
|
jdufault
2016/06/17 18:54:23
I'd put loadPinKeyboardIfNeeded at the end of the
sammiequon
2016/06/22 23:26:17
Done.
| |
| 221 $('pod-row').loadPods(users); | |
| 222 $('login-header-bar').showGuestButton = showGuest; | 222 $('login-header-bar').showGuestButton = showGuest; |
| 223 // On Desktop, #login-header-bar has a shadow if there are 8+ profiles. | 223 // On Desktop, #login-header-bar has a shadow if there are 8+ profiles. |
| 224 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) | 224 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) |
| 225 $('login-header-bar').classList.toggle('shadow', users.length > 8); | 225 $('login-header-bar').classList.toggle('shadow', users.length > 8); |
| 226 }, | 226 }, |
| 227 | 227 |
| 228 /** | 228 /** |
| 229 * Runs app with a given id from the list of loaded apps. | 229 * Runs app with a given id from the list of loaded apps. |
| 230 * @param {!string} app_id of an app to run. | 230 * @param {!string} app_id of an app to run. |
| 231 * @param {boolean=} opt_diagnostic_mode Whether to run the app in | 231 * @param {boolean=} opt_diagnostic_mode Whether to run the app in |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 * @param {string} userID The user ID of the public session | 403 * @param {string} userID The user ID of the public session |
| 404 * @param {string} locale The locale to which this list of keyboard layouts | 404 * @param {string} locale The locale to which this list of keyboard layouts |
| 405 * applies | 405 * applies |
| 406 * @param {!Object} list List of available keyboard layouts | 406 * @param {!Object} list List of available keyboard layouts |
| 407 */ | 407 */ |
| 408 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 408 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
| 409 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 409 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
| 410 } | 410 } |
| 411 }; | 411 }; |
| 412 }); | 412 }); |
| OLD | NEW |