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 // Update the pod row display if incorrect password. | 180 // Update the pod row display if incorrect password. |
| 181 $('pod-row').setFocusedPodErrorDisplay(true); | 181 $('pod-row').setFocusedPodErrorDisplay(true); |
| 182 // We want bubble's arrow to point to the first letter of input. | 182 // We want bubble's arrow to point to the first letter of input. |
| 183 /** @const */ var BUBBLE_OFFSET = 7; | 183 /** @const */ var BUBBLE_OFFSET = 0; |
| 184 /** @const */ var BUBBLE_PADDING = 4; | 184 /** @const */ var BUBBLE_PADDING = -6; |
| 185 | 185 |
| 186 // Anchor the bubble to the pod instead of the input if the pin keyboard | 186 // Anchor the bubble to the pod instead of the input. |
| 187 // is showing to avoid covering parts of the pin keyboard. | 187 var bubbleAnchor = activatedPod; |
|
jdufault
2016/11/01 15:32:52
This works as expected when PIN is enabled?
PIN g
| |
| 188 var bubbleAnchor; | |
| 189 if (activatedPod.pinContainer) | |
| 190 bubbleAnchor = activatedPod; | |
| 191 else | |
| 192 bubbleAnchor = activatedPod.mainInput; | |
| 193 | 188 |
| 194 // We want the bubble to point to where the input is after it is done | 189 // We want the bubble to point to where the input is after it is done |
| 195 // transitioning. | 190 // transitioning. |
| 196 var showBottomCallback = function() { | 191 var showBottomCallback = function() { |
| 197 activatedPod.removeEventListener("webkitTransitionEnd", | 192 activatedPod.removeEventListener("webkitTransitionEnd", |
| 198 showBottomCallback); | 193 showBottomCallback); |
| 199 $('bubble').showContentForElement(bubbleAnchor, | 194 $('bubble').showContentForElement(bubbleAnchor, |
| 200 cr.ui.Bubble.Attachment.BOTTOM, | 195 cr.ui.Bubble.Attachment.BOTTOM, |
| 201 error, | 196 error, |
| 202 BUBBLE_OFFSET, BUBBLE_PADDING); | 197 BUBBLE_OFFSET, BUBBLE_PADDING, |
| 198 true); | |
| 203 }; | 199 }; |
| 204 activatedPod.addEventListener("webkitTransitionEnd", | 200 activatedPod.addEventListener("webkitTransitionEnd", |
| 205 showBottomCallback); | 201 showBottomCallback); |
| 206 ensureTransitionEndEvent(activatedPod); | 202 ensureTransitionEndEvent(activatedPod); |
| 207 | 203 |
| 208 // Move error bubble up if it overlaps the shelf. | 204 // Move error bubble up if it overlaps the shelf. |
| 209 var maxHeight = | 205 var maxHeight = |
| 210 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); | 206 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); |
| 211 if (maxHeight < $('bubble').offsetHeight) { | 207 if (maxHeight < $('bubble').offsetHeight) { |
| 212 var showTopCallback = function() { | 208 var showTopCallback = function() { |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 * @param {string} userID The user ID of the public session | 424 * @param {string} userID The user ID of the public session |
| 429 * @param {string} locale The locale to which this list of keyboard layouts | 425 * @param {string} locale The locale to which this list of keyboard layouts |
| 430 * applies | 426 * applies |
| 431 * @param {!Object} list List of available keyboard layouts | 427 * @param {!Object} list List of available keyboard layouts |
| 432 */ | 428 */ |
| 433 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 429 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
| 434 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 430 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
| 435 } | 431 } |
| 436 }; | 432 }; |
| 437 }); | 433 }); |
| OLD | NEW |