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 | 8 |
| 9 login.createScreen('AccountPickerScreen', 'account-picker', function() { | 9 login.createScreen('AccountPickerScreen', 'account-picker', function() { |
| 10 /** | 10 /** |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 [activatedPod.user.emailAddress]); | 173 [activatedPod.user.emailAddress]); |
| 174 activatedPod.showSigninUI(); | 174 activatedPod.showSigninUI(); |
| 175 } else { | 175 } else { |
| 176 if (loginAttempts == 1) { | 176 if (loginAttempts == 1) { |
| 177 chrome.send('firstIncorrectPasswordAttempt', | 177 chrome.send('firstIncorrectPasswordAttempt', |
| 178 [activatedPod.user.emailAddress]); | 178 [activatedPod.user.emailAddress]); |
| 179 } | 179 } |
| 180 // We want bubble's arrow to point to the first letter of input. | 180 // We want bubble's arrow to point to the first letter of input. |
| 181 /** @const */ var BUBBLE_OFFSET = 7; | 181 /** @const */ var BUBBLE_OFFSET = 7; |
| 182 /** @const */ var BUBBLE_PADDING = 4; | 182 /** @const */ var BUBBLE_PADDING = 4; |
| 183 $('bubble').showContentForElement(activatedPod.mainInput, | 183 |
| 184 cr.ui.Bubble.Attachment.BOTTOM, | 184 // We want the bubble to point to where the input is after it is done |
| 185 error, | 185 // tranisitioning. |
| 186 BUBBLE_OFFSET, BUBBLE_PADDING); | 186 var showBottomCallback = function() { |
| 187 activatedPod.removeEventListener("webkitTransitionEnd", | |
| 188 showBottomCallback); | |
| 189 $('bubble').showContentForElement(activatedPod.mainInput, | |
| 190 cr.ui.Bubble.Attachment.BOTTOM, | |
| 191 error, | |
| 192 BUBBLE_OFFSET, BUBBLE_PADDING); | |
| 193 }; | |
| 194 activatedPod.addEventListener("webkitTransitionEnd", showBottomCallback, | |
| 195 false); | |
| 196 // Guard timer set to animation duration + 50ms. | |
|
jdufault
2016/08/26 01:12:31
Remove comment
sammiequon
2016/08/29 22:00:21
Done.
| |
| 197 ensureTransitionEndEvent(activatedPod); | |
| 198 | |
| 187 // Move error bubble up if it overlaps the shelf. | 199 // Move error bubble up if it overlaps the shelf. |
| 188 var maxHeight = | 200 var maxHeight = |
| 189 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); | 201 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); |
| 190 if (maxHeight < $('bubble').offsetHeight) { | 202 if (maxHeight < $('bubble').offsetHeight) { |
| 191 $('bubble').showContentForElement(activatedPod.mainInput, | 203 var showTopCallback = function() { |
| 192 cr.ui.Bubble.Attachment.TOP, | 204 activatedPod.removeEventListener("webkitTransitionEnd", |
| 193 error, | 205 showTopCallback); |
| 194 BUBBLE_OFFSET, BUBBLE_PADDING); | 206 $('bubble').showContentForElement(activatedPod.mainInput, |
| 207 cr.ui.Bubble.Attachment.TOP, | |
| 208 error, | |
| 209 BUBBLE_OFFSET, BUBBLE_PADDING); | |
| 210 }; | |
| 211 activatedPod.addEventListener("webkitTransitionEnd", showTopCallback, | |
| 212 false); | |
| 213 // Guard timer set to animation duration + 50ms. | |
| 214 ensureTransitionEndEvent(activatedPod); | |
| 195 } | 215 } |
| 196 } | 216 } |
| 197 }, | 217 }, |
| 198 | 218 |
| 199 /** | 219 /** |
| 200 * Loads the PIN keyboard if any of the users can login with a PIN. | 220 * Loads the PIN keyboard if any of the users can login with a PIN. |
| 201 * @param {array} users Array of user instances. | 221 * @param {array} users Array of user instances. |
| 202 */ | 222 */ |
| 203 loadPinKeyboardIfNeeded_: function(users) { | 223 loadPinKeyboardIfNeeded_: function(users) { |
| 204 for (var i = 0; i < users.length; ++i) { | 224 for (var i = 0; i < users.length; ++i) { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 | 368 |
| 349 /** | 369 /** |
| 350 * Sets the state of touch view mode. | 370 * Sets the state of touch view mode. |
| 351 * @param {boolean} isTouchViewEnabled true if the mode is on. | 371 * @param {boolean} isTouchViewEnabled true if the mode is on. |
| 352 */ | 372 */ |
| 353 setTouchViewState: function(isTouchViewEnabled) { | 373 setTouchViewState: function(isTouchViewEnabled) { |
| 354 $('pod-row').setTouchViewState(isTouchViewEnabled); | 374 $('pod-row').setTouchViewState(isTouchViewEnabled); |
| 355 }, | 375 }, |
| 356 | 376 |
| 357 /** | 377 /** |
| 358 * Hides the PIN keyboard if it's active. | 378 * Removes the PIN keyboard so the user can no longer enter a PIN. |
| 359 * @param {!user} user The user who can no longer enter a PIN. | 379 * @param {!user} user The user who can no longer enter a PIN. |
| 360 */ | 380 */ |
| 361 disablePinKeyboardForUser: function(user) { | 381 disablePinKeyboardForUser: function(user) { |
| 362 $('pod-row').setPinVisibility(user, false); | 382 $('pod-row').removePinKeyboard(user); |
| 363 }, | 383 }, |
| 364 | 384 |
| 365 /** | 385 /** |
| 366 * Updates the display name shown on a public session pod. | 386 * Updates the display name shown on a public session pod. |
| 367 * @param {string} userID The user ID of the public session | 387 * @param {string} userID The user ID of the public session |
| 368 * @param {string} displayName The new display name | 388 * @param {string} displayName The new display name |
| 369 */ | 389 */ |
| 370 setPublicSessionDisplayName: function(userID, displayName) { | 390 setPublicSessionDisplayName: function(userID, displayName) { |
| 371 $('pod-row').setPublicSessionDisplayName(userID, displayName); | 391 $('pod-row').setPublicSessionDisplayName(userID, displayName); |
| 372 }, | 392 }, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 394 * @param {string} userID The user ID of the public session | 414 * @param {string} userID The user ID of the public session |
| 395 * @param {string} locale The locale to which this list of keyboard layouts | 415 * @param {string} locale The locale to which this list of keyboard layouts |
| 396 * applies | 416 * applies |
| 397 * @param {!Object} list List of available keyboard layouts | 417 * @param {!Object} list List of available keyboard layouts |
| 398 */ | 418 */ |
| 399 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 419 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
| 400 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 420 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
| 401 } | 421 } |
| 402 }; | 422 }; |
| 403 }); | 423 }); |
| OLD | NEW |