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