| 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 User pod row implementation. | 6 * @fileoverview User pod row implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 /** | 10 /** |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 this.handleRemoveCommandKeyDown_.bind(this)); | 725 this.handleRemoveCommandKeyDown_.bind(this)); |
| 726 this.actionBoxMenuRemoveElement.addEventListener('blur', | 726 this.actionBoxMenuRemoveElement.addEventListener('blur', |
| 727 this.handleRemoveCommandBlur_.bind(this)); | 727 this.handleRemoveCommandBlur_.bind(this)); |
| 728 this.actionBoxRemoveUserWarningButtonElement.addEventListener( | 728 this.actionBoxRemoveUserWarningButtonElement.addEventListener( |
| 729 'click', | 729 'click', |
| 730 this.handleRemoveUserConfirmationClick_.bind(this)); | 730 this.handleRemoveUserConfirmationClick_.bind(this)); |
| 731 this.actionBoxRemoveUserWarningButtonElement.addEventListener( | 731 this.actionBoxRemoveUserWarningButtonElement.addEventListener( |
| 732 'keydown', | 732 'keydown', |
| 733 this.handleRemoveUserConfirmationKeyDown_.bind(this)); | 733 this.handleRemoveUserConfirmationKeyDown_.bind(this)); |
| 734 | 734 |
| 735 var pinKeyboard = document.getElementById('pin-keyboard'); |
| 736 pinKeyboard.addEventListener('submit', |
| 737 this.handlePinSubmitted_.bind(this)); |
| 738 |
| 735 var customIcon = this.customIconElement; | 739 var customIcon = this.customIconElement; |
| 736 customIcon.parentNode.replaceChild(new UserPodCustomIcon(), customIcon); | 740 customIcon.parentNode.replaceChild(new UserPodCustomIcon(), customIcon); |
| 737 }, | 741 }, |
| 738 | 742 |
| 739 /** | 743 /** |
| 740 * Initializes the pod after its properties set and added to a pod row. | 744 * Initializes the pod after its properties set and added to a pod row. |
| 741 */ | 745 */ |
| 742 initialize: function() { | 746 initialize: function() { |
| 743 this.passwordElement.addEventListener('keydown', | 747 this.passwordElement.addEventListener('keydown', |
| 744 this.parentNode.handleKeyDown.bind(this.parentNode)); | 748 this.parentNode.handleKeyDown.bind(this.parentNode)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 758 /** | 762 /** |
| 759 * Resets tab order for pod elements to its initial state. | 763 * Resets tab order for pod elements to its initial state. |
| 760 */ | 764 */ |
| 761 resetTabOrder: function() { | 765 resetTabOrder: function() { |
| 762 // Note: the |mainInput| can be the pod itself. | 766 // Note: the |mainInput| can be the pod itself. |
| 763 this.mainInput.tabIndex = -1; | 767 this.mainInput.tabIndex = -1; |
| 764 this.tabIndex = UserPodTabOrder.POD_INPUT; | 768 this.tabIndex = UserPodTabOrder.POD_INPUT; |
| 765 }, | 769 }, |
| 766 | 770 |
| 767 /** | 771 /** |
| 772 * Handles the user hitting 'submit' on the PIN keyboard. |
| 773 * @param {Event} e Submit event object. |
| 774 * @private |
| 775 */ |
| 776 handlePinSubmitted_: function(e) { |
| 777 var pin = e.detail.pin; |
| 778 chrome.send('authenticateUserWithPin', [this.user.username, pin]); |
| 779 }, |
| 780 |
| 781 /** |
| 768 * Handles keypress event (i.e. any textual input) on password input. | 782 * Handles keypress event (i.e. any textual input) on password input. |
| 769 * @param {Event} e Keypress Event object. | 783 * @param {Event} e Keypress Event object. |
| 770 * @private | 784 * @private |
| 771 */ | 785 */ |
| 772 handlePasswordKeyPress_: function(e) { | 786 handlePasswordKeyPress_: function(e) { |
| 773 // When tabbing from the system tray a tab key press is received. Suppress | 787 // When tabbing from the system tray a tab key press is received. Suppress |
| 774 // this so as not to type a tab character into the password field. | 788 // this so as not to type a tab character into the password field. |
| 775 if (e.keyCode == 9) { | 789 if (e.keyCode == 9) { |
| 776 e.preventDefault(); | 790 e.preventDefault(); |
| 777 return; | 791 return; |
| (...skipping 2565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3343 if (pod && pod.multiProfilesPolicyApplied) { | 3357 if (pod && pod.multiProfilesPolicyApplied) { |
| 3344 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3358 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3345 } | 3359 } |
| 3346 } | 3360 } |
| 3347 }; | 3361 }; |
| 3348 | 3362 |
| 3349 return { | 3363 return { |
| 3350 PodRow: PodRow | 3364 PodRow: PodRow |
| 3351 }; | 3365 }; |
| 3352 }); | 3366 }); |
| OLD | NEW |