| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 var activatedPod = $('pod-row').activatedPod; | 160 var activatedPod = $('pod-row').activatedPod; |
| 161 if (!activatedPod) { | 161 if (!activatedPod) { |
| 162 $('bubble').showContentForElement($('pod-row'), | 162 $('bubble').showContentForElement($('pod-row'), |
| 163 cr.ui.Bubble.Attachment.RIGHT, | 163 cr.ui.Bubble.Attachment.RIGHT, |
| 164 error); | 164 error); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 // Show web authentication if this is not a supervised user. | 167 // Show web authentication if this is not a supervised user. |
| 168 if (loginAttempts > MAX_LOGIN_ATTEMPTS_IN_POD && | 168 if (loginAttempts > MAX_LOGIN_ATTEMPTS_IN_POD && |
| 169 !activatedPod.user.supervisedUser) { | 169 !activatedPod.user.supervisedUser) { |
| 170 chrome.send('maxIncorrectPasswordAttempts', |
| 171 [activatedPod.user.emailAddress]); |
| 170 activatedPod.showSigninUI(); | 172 activatedPod.showSigninUI(); |
| 171 } else { | 173 } else { |
| 174 if (loginAttempts == 1) { |
| 175 chrome.send('firstIncorrectPasswordAttempt', |
| 176 [activatedPod.user.emailAddress]); |
| 177 } |
| 172 // We want bubble's arrow to point to the first letter of input. | 178 // We want bubble's arrow to point to the first letter of input. |
| 173 /** @const */ var BUBBLE_OFFSET = 7; | 179 /** @const */ var BUBBLE_OFFSET = 7; |
| 174 /** @const */ var BUBBLE_PADDING = 4; | 180 /** @const */ var BUBBLE_PADDING = 4; |
| 175 $('bubble').showContentForElement(activatedPod.mainInput, | 181 $('bubble').showContentForElement(activatedPod.mainInput, |
| 176 cr.ui.Bubble.Attachment.BOTTOM, | 182 cr.ui.Bubble.Attachment.BOTTOM, |
| 177 error, | 183 error, |
| 178 BUBBLE_OFFSET, BUBBLE_PADDING); | 184 BUBBLE_OFFSET, BUBBLE_PADDING); |
| 179 // Move error bubble up if it overlaps the shelf. | 185 // Move error bubble up if it overlaps the shelf. |
| 180 var maxHeight = | 186 var maxHeight = |
| 181 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); | 187 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 * @param {string} userID The user ID of the public session | 365 * @param {string} userID The user ID of the public session |
| 360 * @param {string} locale The locale to which this list of keyboard layouts | 366 * @param {string} locale The locale to which this list of keyboard layouts |
| 361 * applies | 367 * applies |
| 362 * @param {!Object} list List of available keyboard layouts | 368 * @param {!Object} list List of available keyboard layouts |
| 363 */ | 369 */ |
| 364 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 370 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
| 365 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 371 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
| 366 } | 372 } |
| 367 }; | 373 }; |
| 368 }); | 374 }); |
| OLD | NEW |