Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: ui/login/account_picker/user_pod_row.js

Issue 2027683003: Pin keyboard moved to under the user profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Made transition smoother. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
742 var customIcon = this.customIconElement; 735 var customIcon = this.customIconElement;
743 customIcon.parentNode.replaceChild(new UserPodCustomIcon(), customIcon); 736 customIcon.parentNode.replaceChild(new UserPodCustomIcon(), customIcon);
744 }, 737 },
745 738
746 /** 739 /**
747 * Initializes the pod after its properties set and added to a pod row. 740 * Initializes the pod after its properties set and added to a pod row.
748 */ 741 */
749 initialize: function() { 742 initialize: function() {
750 this.passwordElement.addEventListener('keydown', 743 this.passwordElement.addEventListener('keydown',
751 this.parentNode.handleKeyDown.bind(this.parentNode)); 744 this.parentNode.handleKeyDown.bind(this.parentNode));
752 this.passwordElement.addEventListener('keypress', 745 this.passwordElement.addEventListener('keypress',
753 this.handlePasswordKeyPress_.bind(this)); 746 this.handlePasswordKeyPress_.bind(this));
754 747
748 if(this.pinKeyboard) {
jdufault 2016/06/14 22:50:33 nit: if (
sammiequon 2016/06/15 21:56:59 Done.
749 this.pinKeyboard.addEventListener('submit',
750 this.handlePinSubmitted_.bind(this));
jdufault 2016/06/14 22:50:34 nit: 4 space indent
sammiequon 2016/06/15 21:56:59 Done.
751 }
752
755 this.imageElement.addEventListener('load', 753 this.imageElement.addEventListener('load',
756 this.parentNode.handlePodImageLoad.bind(this.parentNode, this)); 754 this.parentNode.handlePodImageLoad.bind(this.parentNode, this));
757 755
758 var initialAuthType = this.user.initialAuthType || 756 var initialAuthType = this.user.initialAuthType ||
759 AUTH_TYPE.OFFLINE_PASSWORD; 757 AUTH_TYPE.OFFLINE_PASSWORD;
760 this.setAuthType(initialAuthType, null); 758 this.setAuthType(initialAuthType, null);
761 759
762 this.userClickAuthAllowed_ = false; 760 this.userClickAuthAllowed_ = false;
761
762 // var pinkeyboard = $('pin-keyboard');
763 // // the pin keyboard is not present on the md user manager.
jdufault 2016/06/14 22:50:33 Remove this code
764 // if (pinkeyboard) {
765 // pinkeyboard.addeventlistener('submit',
766 // this.handlepinsubmitted_.bind(this));
767 // }
763 }, 768 },
764 769
765 /** 770 /**
766 * Resets tab order for pod elements to its initial state. 771 * Resets tab order for pod elements to its initial state.
767 */ 772 */
768 resetTabOrder: function() { 773 resetTabOrder: function() {
769 // Note: the |mainInput| can be the pod itself. 774 // Note: the |mainInput| can be the pod itself.
770 this.mainInput.tabIndex = -1; 775 this.mainInput.tabIndex = -1;
771 this.tabIndex = UserPodTabOrder.POD_INPUT; 776 this.tabIndex = UserPodTabOrder.POD_INPUT;
772 }, 777 },
773 778
774 /** 779 /**
775 * Handles the user hitting 'submit' on the PIN keyboard. 780 * Handles the user hitting 'submit' on the PIN keyboard.
776 * @param {Event} e Submit event object. 781 * @param {Event} e Submit event object.
777 * @private 782 * @private
778 */ 783 */
779 handlePinSubmitted_: function(e) { 784 handlePinSubmitted_: function(e) {
780 var pin = e.detail.pin; 785 var pin = e.detail.pin;
781 chrome.send('authenticateUserWithPin', [this.user.username, pin]); 786 chrome.send('authenticateUser', [this.user.username, pin]);
jdufault 2016/06/14 22:50:34 Revert this change.
782 }, 787 },
783 788
784 /** 789 /**
785 * Handles keypress event (i.e. any textual input) on password input. 790 * Handles keypress event (i.e. any textual input) on password input.
786 * @param {Event} e Keypress Event object. 791 * @param {Event} e Keypress Event object.
787 * @private 792 * @private
788 */ 793 */
789 handlePasswordKeyPress_: function(e) { 794 handlePasswordKeyPress_: function(e) {
790 // When tabbing from the system tray a tab key press is received. Suppress 795 // When tabbing from the system tray a tab key press is received. Suppress
791 // this so as not to type a tab character into the password field. 796 // this so as not to type a tab character into the password field.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 /** 881 /**
877 * Gets the password label, which is used to show a message where the 882 * Gets the password label, which is used to show a message where the
878 * password field is normally. 883 * password field is normally.
879 * @type {!HTMLInputElement} 884 * @type {!HTMLInputElement}
880 */ 885 */
881 get passwordLabelElement() { 886 get passwordLabelElement() {
882 return this.querySelector('.password-label'); 887 return this.querySelector('.password-label');
883 }, 888 },
884 889
885 /** 890 /**
891 * Gets the pin-keyboard of the pod.
892 * @type {!HTMLElement}
893 */
894 get pinKeyboard() {
895 return this.querySelector('pin-keyboard');
896 },
897
898 /**
886 * Gets user online sign in hint element. 899 * Gets user online sign in hint element.
887 * @type {!HTMLDivElement} 900 * @type {!HTMLDivElement}
888 */ 901 */
889 get reauthWarningElement() { 902 get reauthWarningElement() {
890 return this.querySelector('.reauth-hint-container'); 903 return this.querySelector('.reauth-hint-container');
891 }, 904 },
892 905
893 /** 906 /**
894 * Gets the container holding the launch app button. 907 * Gets the container holding the launch app button.
895 * @type {!HTMLButtonElement} 908 * @type {!HTMLButtonElement}
(...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after
3363 if (pod && pod.multiProfilesPolicyApplied) { 3376 if (pod && pod.multiProfilesPolicyApplied) {
3364 pod.userTypeBubbleElement.classList.remove('bubble-shown'); 3377 pod.userTypeBubbleElement.classList.remove('bubble-shown');
3365 } 3378 }
3366 } 3379 }
3367 }; 3380 };
3368 3381
3369 return { 3382 return {
3370 PodRow: PodRow 3383 PodRow: PodRow
3371 }; 3384 };
3372 }); 3385 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698