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

Unified Diff: ui/login/account_picker/user_pod_row.js

Issue 2444443002: cros: Allow pin keyboard to keep focus without popping up the pin keyboard. (Closed)
Patch Set: Moved blocking variable to scoped class. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/keyboard/scoped_keyboard_disabler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54df155a8cf1dfdc590cfccf2502624ad46c25ee..08ac15110aeab7a9fbb655305f49bb371c79238e 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -714,8 +714,9 @@ cr.define('login', function() {
this.addEventListener('mousedown', this.handlePodMouseDown_.bind(this));
if (this.pinKeyboard) {
+ this.pinKeyboard.passwordElement = this.passwordElement;
this.pinKeyboard.addEventListener('pin-change',
- this.handlePinChanged_.bind(this));
+ this.handleInputChanged_.bind(this));
}
this.actionBoxAreaElement.addEventListener('mousedown',
@@ -755,6 +756,8 @@ cr.define('login', function() {
this.handlePasswordKeyPress_.bind(this));
this.passwordElement.addEventListener('input',
this.handleInputChanged_.bind(this));
+ this.passwordElement.addEventListener('mouseup',
+ this.handleInputMouseUp_.bind(this));
if (this.submitButton) {
this.submitButton.addEventListener('click',
@@ -1167,6 +1170,8 @@ cr.define('login', function() {
// Change the password placeholder based on pin keyboard visibility.
this.passwordElement.placeholder = loadTimeData.getString(visible ?
'pinKeyboardPlaceholderPinPassword' : 'passwordHint');
+
+ chrome.send('setForceDisableVirtualKeyboard', [visible]);
},
isPinShown: function() {
@@ -1867,24 +1872,24 @@ cr.define('login', function() {
},
/**
- * Handles pin change event from the pin keyboard.
- * @param {Event} e Pin change event.
+ * Handles input event on the password element.
+ * @param {Event} e Input event.
*/
- handlePinChanged_: function(e) {
- this.passwordElement.value = e.detail.pin;
+ handleInputChanged_: function(e) {
this.updateInput_();
},
/**
- * Handles input event on the password element.
- * @param {Event} e Input event.
+ * Handles mouse up event on the password element.
+ * @param {Event} e Mouse up event.
*/
- handleInputChanged_: function(e) {
- if (this.pinKeyboard)
- this.pinKeyboard.value = this.passwordElement.value;
- if (this.submitButton)
- this.submitButton.disabled = this.passwordElement.value.length <= 0;
- this.updateInput_();
+ handleInputMouseUp_: function(e) {
+ // If the PIN keyboard is shown and the user clicks on the password
+ // element, the virtual keyboard should pop up if it is enabled, so we
+ // must disable the virtual keyboard override.
+ if (this.isPinShown()) {
+ chrome.send('setForceDisableVirtualKeyboard', [false]);
+ }
},
/**
« no previous file with comments | « ui/keyboard/scoped_keyboard_disabler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698