| 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 10 matching lines...) Expand all Loading... |
| 21 'setApps', | 21 'setApps', |
| 22 'setShouldShowApps', | 22 'setShouldShowApps', |
| 23 'showAppError', | 23 'showAppError', |
| 24 'updateUserImage', | 24 'updateUserImage', |
| 25 'setCapsLockState', | 25 'setCapsLockState', |
| 26 'forceLockedUserPodFocus', | 26 'forceLockedUserPodFocus', |
| 27 'removeUser', | 27 'removeUser', |
| 28 'showBannerMessage', | 28 'showBannerMessage', |
| 29 'showUserPodCustomIcon', | 29 'showUserPodCustomIcon', |
| 30 'hideUserPodCustomIcon', | 30 'hideUserPodCustomIcon', |
| 31 'disablePinKeyboardForUser', |
| 31 'setAuthType', | 32 'setAuthType', |
| 32 'setTouchViewState', | 33 'setTouchViewState', |
| 33 'setPublicSessionDisplayName', | 34 'setPublicSessionDisplayName', |
| 34 'setPublicSessionLocales', | 35 'setPublicSessionLocales', |
| 35 'setPublicSessionKeyboardLayouts', | 36 'setPublicSessionKeyboardLayouts', |
| 36 ], | 37 ], |
| 37 | 38 |
| 38 preferredWidth_: 0, | 39 preferredWidth_: 0, |
| 39 preferredHeight_: 0, | 40 preferredHeight_: 0, |
| 40 | 41 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 if (maxHeight < $('bubble').offsetHeight) { | 190 if (maxHeight < $('bubble').offsetHeight) { |
| 190 $('bubble').showContentForElement(activatedPod.mainInput, | 191 $('bubble').showContentForElement(activatedPod.mainInput, |
| 191 cr.ui.Bubble.Attachment.TOP, | 192 cr.ui.Bubble.Attachment.TOP, |
| 192 error, | 193 error, |
| 193 BUBBLE_OFFSET, BUBBLE_PADDING); | 194 BUBBLE_OFFSET, BUBBLE_PADDING); |
| 194 } | 195 } |
| 195 } | 196 } |
| 196 }, | 197 }, |
| 197 | 198 |
| 198 /** | 199 /** |
| 200 * Loads the PIN keyboard if any of the users can login with a PIN. |
| 201 * @param {array} users Array of user instances. |
| 202 */ |
| 203 loadPinKeyboardIfNeeded_: function(users) { |
| 204 for (var i = 0; i < users.length; ++i) { |
| 205 var user = users[i]; |
| 206 if (user.showPin) { |
| 207 showPinKeyboardAsync(); |
| 208 return; |
| 209 } |
| 210 } |
| 211 }, |
| 212 |
| 213 /** |
| 199 * Loads given users in pod row. | 214 * Loads given users in pod row. |
| 200 * @param {array} users Array of user. | 215 * @param {array} users Array of user. |
| 201 * @param {boolean} showGuest Whether to show guest session button. | 216 * @param {boolean} showGuest Whether to show guest session button. |
| 202 */ | 217 */ |
| 203 loadUsers: function(users, showGuest) { | 218 loadUsers: function(users, showGuest) { |
| 219 this.loadPinKeyboardIfNeeded_(users); |
| 220 |
| 204 $('pod-row').loadPods(users); | 221 $('pod-row').loadPods(users); |
| 205 $('login-header-bar').showGuestButton = showGuest; | 222 $('login-header-bar').showGuestButton = showGuest; |
| 206 // 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. |
| 207 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) | 224 if (Oobe.getInstance().displayType == DISPLAY_TYPE.DESKTOP_USER_MANAGER) |
| 208 $('login-header-bar').classList.toggle('shadow', users.length > 8); | 225 $('login-header-bar').classList.toggle('shadow', users.length > 8); |
| 209 }, | 226 }, |
| 210 | 227 |
| 211 /** | 228 /** |
| 212 * 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. |
| 213 * @param {!string} app_id of an app to run. | 230 * @param {!string} app_id of an app to run. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 348 |
| 332 /** | 349 /** |
| 333 * Sets the state of touch view mode. | 350 * Sets the state of touch view mode. |
| 334 * @param {boolean} isTouchViewEnabled true if the mode is on. | 351 * @param {boolean} isTouchViewEnabled true if the mode is on. |
| 335 */ | 352 */ |
| 336 setTouchViewState: function(isTouchViewEnabled) { | 353 setTouchViewState: function(isTouchViewEnabled) { |
| 337 $('pod-row').setTouchViewState(isTouchViewEnabled); | 354 $('pod-row').setTouchViewState(isTouchViewEnabled); |
| 338 }, | 355 }, |
| 339 | 356 |
| 340 /** | 357 /** |
| 358 * Hides the PIN keyboard if it's active. |
| 359 * @param {!user} user The user who can no longer enter a PIN. |
| 360 */ |
| 361 disablePinKeyboardForUser: function(user) { |
| 362 var pinContainer = $('pin-container'); |
| 363 |
| 364 // Transition opacity to 0, and when the transition is done hide the |
| 365 // keyboard so it doesn't take layout space. |
| 366 pinContainer.style.opacity = 0; |
| 367 pinContainer.addEventListener('webkitTransitionEnd', function f(e) { |
| 368 pinContainer.removeEventListener('webkitTransitionEnd', f); |
| 369 pinContainer.hidden = true; |
| 370 }); |
| 371 ensureTransitionEndEvent(pinContainer); |
| 372 }, |
| 373 |
| 374 /** |
| 341 * Updates the display name shown on a public session pod. | 375 * Updates the display name shown on a public session pod. |
| 342 * @param {string} userID The user ID of the public session | 376 * @param {string} userID The user ID of the public session |
| 343 * @param {string} displayName The new display name | 377 * @param {string} displayName The new display name |
| 344 */ | 378 */ |
| 345 setPublicSessionDisplayName: function(userID, displayName) { | 379 setPublicSessionDisplayName: function(userID, displayName) { |
| 346 $('pod-row').setPublicSessionDisplayName(userID, displayName); | 380 $('pod-row').setPublicSessionDisplayName(userID, displayName); |
| 347 }, | 381 }, |
| 348 | 382 |
| 349 /** | 383 /** |
| 350 * Updates the list of locales available for a public session. | 384 * Updates the list of locales available for a public session. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 369 * @param {string} userID The user ID of the public session | 403 * @param {string} userID The user ID of the public session |
| 370 * @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 |
| 371 * applies | 405 * applies |
| 372 * @param {!Object} list List of available keyboard layouts | 406 * @param {!Object} list List of available keyboard layouts |
| 373 */ | 407 */ |
| 374 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 408 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
| 375 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 409 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
| 376 } | 410 } |
| 377 }; | 411 }; |
| 378 }); | 412 }); |
| OLD | NEW |