Chromium Code Reviews| Index: ui/login/account_picker/user_pod_row.js |
| diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js |
| index 48a7073ad110d478bd66bc14505e630c93751e20..5fd868be70effa6ffdb9eeefa37dc7be8271f298 100644 |
| --- a/ui/login/account_picker/user_pod_row.js |
| +++ b/ui/login/account_picker/user_pod_row.js |
| @@ -748,11 +748,6 @@ cr.define('login', function() { |
| this.passwordElement.addEventListener('keypress', |
| this.handlePasswordKeyPress_.bind(this)); |
| - if (this.pinKeyboard) { |
| - this.pinKeyboard.addEventListener('submit', |
| - this.handlePinSubmitted_.bind(this)); |
| - } |
| - |
| this.imageElement.addEventListener('load', |
| this.parentNode.handlePodImageLoad.bind(this.parentNode, this)); |
| @@ -773,16 +768,6 @@ cr.define('login', function() { |
| }, |
| /** |
| - * Handles the user hitting 'submit' on the PIN keyboard. |
| - * @param {Event} e Submit event object. |
| - * @private |
| - */ |
| - handlePinSubmitted_: function(e) { |
| - var pin = e.detail.pin; |
| - chrome.send('authenticateUser', [this.user.username, pin]); |
| - }, |
| - |
| - /** |
| * Handles keypress event (i.e. any textual input) on password input. |
| * @param {Event} e Keypress Event object. |
| * @private |
| @@ -1188,6 +1173,9 @@ cr.define('login', function() { |
| */ |
| get mainInput() { |
| if (this.isAuthTypePassword) { |
| + if (this.pinContainer.classList.contains('pin-enabled')) { |
| + return this.pinKeyboard.inputElement; |
|
jdufault
2016/07/11 23:31:41
nit: remove {}
sammiequon
2016/07/11 23:54:44
Done.
|
| + } |
| return this.passwordElement; |
| } else if (this.isAuthTypeOnlineSignIn) { |
| return this; |
| @@ -1354,11 +1342,13 @@ cr.define('login', function() { |
| this.classList.toggle('signing-in', true); |
| chrome.send('attemptUnlock', [this.user.username]); |
| } else if (this.isAuthTypePassword) { |
| - if (!this.passwordElement.value) |
| + if (!this.passwordElement.value && this.pinKeyboard.inputElement && |
| + !this.pinKeyboard.inputElement.value) |
|
jdufault
2016/07/11 23:31:41
use this.pinKeyboard.value instead of inputElement
sammiequon
2016/07/11 23:54:43
Done.
|
| return false; |
| Oobe.disableSigninUI(); |
| - chrome.send('authenticateUser', |
| - [this.user.username, this.passwordElement.value]); |
| + var password = this.passwordElement.value || |
| + this.pinKeyboard.inputElement.value; |
|
jdufault
2016/07/11 23:31:40
this.pinKeyboard.value instead of pinKeyboard.inpu
sammiequon
2016/07/11 23:54:43
Done.
|
| + chrome.send('authenticateUser', [this.user.username, password]); |
| } else { |
| console.error('Activating user pod with invalid authentication type: ' + |
| this.authType); |
| @@ -1420,6 +1410,8 @@ cr.define('login', function() { |
| */ |
| reset: function(takeFocus) { |
| this.passwordElement.value = ''; |
| + if (this.pinKeyboard.inputElement) |
| + this.pinKeyboard.value = ''; |
| this.classList.toggle('signing-in', false); |
| if (takeFocus) { |
| if (!this.multiProfilesPolicyApplied) |
| @@ -1817,6 +1809,11 @@ cr.define('login', function() { |
| // Note that this.userClickAuthAllowed_ is set in mouse down event |
| // handler. |
| this.parentNode.setActivatedPod(this); |
| + } else if (this.pinKeyboard.submitButton && |
| + e.target == this.pinKeyboard.submitButton) { |
| + // Sets the pod as activated if the submit button is clicked so that |
| + // it simulates what the enter button does for the password/pin. |
| + this.parentNode.setActivatedPod(this); |
| } |
| if (this.multiProfilesPolicyApplied) |
| @@ -3413,6 +3410,7 @@ cr.define('login', function() { |
| if (this.focusedPod_) { |
| var targetTag = e.target.tagName; |
| if (e.target == this.focusedPod_.passwordElement || |
| + e.target == this.focusedPod_.pinKeyboard.inputElement || |
| (targetTag != 'INPUT' && |
| targetTag != 'BUTTON' && |
| targetTag != 'A')) { |