| 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 9e229ec1e22d9fcda5bc0601042776e22e87d8a2..b7a6c1dd316cd8d306a3d663b32b008bef848dde 100644
|
| --- a/ui/login/account_picker/user_pod_row.js
|
| +++ b/ui/login/account_picker/user_pod_row.js
|
| @@ -718,6 +718,8 @@ cr.define('login', function() {
|
| if (this.pinKeyboard) {
|
| this.pinKeyboard.addEventListener('submit',
|
| this.handlePinSubmitted_.bind(this));
|
| + this.pinKeyboard.addEventListener('pin-change',
|
| + this.handlePinChanged_.bind(this));
|
| }
|
|
|
| this.actionBoxAreaElement.addEventListener('mousedown',
|
| @@ -755,6 +757,8 @@ cr.define('login', function() {
|
| this.parentNode.handleKeyDown.bind(this.parentNode));
|
| this.passwordElement.addEventListener('keypress',
|
| this.handlePasswordKeyPress_.bind(this));
|
| + this.passwordElement.addEventListener('input',
|
| + this.handleInputChanged_.bind(this));
|
|
|
| this.imageElement.addEventListener('load',
|
| this.parentNode.handlePodImageLoad.bind(this.parentNode, this));
|
| @@ -876,6 +880,10 @@ cr.define('login', function() {
|
| return this.querySelector('.password-label');
|
| },
|
|
|
| + get pinContainer() {
|
| + return this.querySelector('.pin-container');
|
| + },
|
| +
|
| /**
|
| * Gets the pin-keyboard of the pod.
|
| * @type {!HTMLElement}
|
| @@ -1103,14 +1111,20 @@ cr.define('login', function() {
|
| },
|
|
|
| setPinVisibility: function(visible) {
|
| + if (this.isPinShown() == visible)
|
| + return;
|
| +
|
| + // Do not show pin if virtual keyboard is there.
|
| + if (visible && Oobe.getInstance().virtualKeyboardShown)
|
| + return;
|
| +
|
| var elements = this.getElementsByClassName('pin-tag');
|
| for (var i = 0; i < elements.length; ++i)
|
| this.updatePinClass_(elements[i], visible);
|
| this.updatePinClass_(this, visible);
|
|
|
| // Set the focus to the input element after showing/hiding pin keyboard.
|
| - if (this.pinKeyboard && visible)
|
| - this.pinKeyboard.focus();
|
| + this.mainInput.focus();
|
| },
|
|
|
| isPinShown: function() {
|
| @@ -1152,8 +1166,6 @@ cr.define('login', function() {
|
| */
|
| get mainInput() {
|
| if (this.isAuthTypePassword) {
|
| - if (this.isPinShown() && this.pinKeyboard.inputElement)
|
| - return this.pinKeyboard.inputElement;
|
| return this.passwordElement;
|
| } else if (this.isAuthTypeOnlineSignIn) {
|
| return this;
|
| @@ -1809,6 +1821,15 @@ cr.define('login', function() {
|
| this.parentNode.setActivatedPod(this);
|
| },
|
|
|
| + handlePinChanged_: function(e) {
|
| + this.passwordElement.value = e.detail.pin;
|
| + },
|
| +
|
| + handleInputChanged_: function(e) {
|
| + if (this.pinKeyboard)
|
| + this.pinKeyboard.value = this.passwordElement.value;
|
| + },
|
| +
|
| /**
|
| * Handles click event on a user pod.
|
| * @param {Event} e Click event.
|
| @@ -2609,19 +2630,30 @@ cr.define('login', function() {
|
| },
|
|
|
| /**
|
| - * Toggles pod PIN keyboard visiblity.
|
| + * Function that hides the pin keyboard. Meant to be called when the virtual
|
| + * keyboard is enabled and being toggled.
|
| + * @param {boolean} hidden
|
| + */
|
| + setPinHidden: function(hidden) {
|
| + this.setFocusedPodPinVisibility(!hidden);
|
| + },
|
| +
|
| + /**
|
| + * Remove the pin keyboard from the pod with the given |username|.
|
| * @param {!user} username
|
| * @param {boolean} visible
|
| */
|
| - setPinVisibility: function(username, visible) {
|
| + removePinKeyboard: function(username) {
|
| var pod = this.getPodWithUsername_(username);
|
| if (!pod) {
|
| - console.warn('Attempt to change pin visibility to ' + visible +
|
| - ' for missing pod');
|
| + console.warn('Attempt to remove pin keyboard of missing pod.');
|
| return;
|
| }
|
| -
|
| - pod.setPinVisibility(visible);
|
| + // Remove the child, so that the virtual keyboard cannot bring it up
|
| + // again after three tries.
|
| + if (pod.pinContainer)
|
| + pod.removeChild(pod.pinContainer);
|
| + pod.setPinVisibility(false);
|
| },
|
|
|
| /**
|
| @@ -3163,7 +3195,8 @@ cr.define('login', function() {
|
| var hadFocus = !!this.focusedPod_;
|
| this.focusedPod_ = podToFocus;
|
| if (podToFocus) {
|
| - this.setFocusedPodPinVisibility(true);
|
| + if (!hadFocus)
|
| + this.setFocusedPodPinVisibility(true);
|
| podToFocus.classList.remove('faded');
|
| podToFocus.classList.add('focused');
|
| if (!podToFocus.multiProfilesPolicyApplied) {
|
|
|