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

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

Issue 2302483003: Pin keyboard improvements. (Closed)
Patch Set: Remove async. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.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 b5247b60a07b91fcd892aaf50991b5f9001841c9..544aac18c12e093f292ca2e2353efa6a42e9ce0e 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -714,8 +714,6 @@ cr.define('login', function() {
this.addEventListener('mousedown', this.handlePodMouseDown_.bind(this));
if (this.pinKeyboard) {
- this.pinKeyboard.addEventListener('submit',
- this.handlePinSubmitted_.bind(this));
this.pinKeyboard.addEventListener('pin-change',
this.handlePinChanged_.bind(this));
}
@@ -757,6 +755,7 @@ cr.define('login', function() {
this.handlePasswordKeyPress_.bind(this));
this.passwordElement.addEventListener('input',
this.handleInputChanged_.bind(this));
+
this.submitButton.addEventListener('click',
this.handleSubmitButtonClick_.bind(this));
@@ -1159,6 +1158,10 @@ cr.define('login', function() {
// Set the focus to the input element after showing/hiding pin keyboard.
this.mainInput.focus();
+
+ // Change the password placeholder based on pin keyboard visibility.
+ this.passwordElement.placeholder = loadTimeData.getString(visible ?
+ 'pinKeyboardPlaceholderPinPassword' : 'passwordHint');
},
isPinShown: function() {
@@ -1847,23 +1850,32 @@ cr.define('login', function() {
},
/**
- * Handles click event on submit button on the pin keyboard.
- * @param {Event} e Click event.
+ * Called when the input of the password element changes. Updates the submit
+ * button color and state and hides the error popup bubble.
*/
- handlePinSubmitted_: function(e) {
- if (this.parentNode.isFocused(this))
- this.parentNode.setActivatedPod(this);
+ updateInput_: function() {
+ this.submitButton.disabled = this.passwordElement.value.length <= 0;
+ this.showError = false;
+ $('bubble').hide();
},
+ /**
+ * Handles pin change event from the pin keyboard.
+ * @param {Event} e Pin change event.
+ */
handlePinChanged_: function(e) {
this.passwordElement.value = e.detail.pin;
+ this.updateInput_();
},
+ /**
+ * Handles input event on the password element.
+ * @param {Event} e Input event.
+ */
handleInputChanged_: function(e) {
if (this.pinKeyboard)
this.pinKeyboard.value = this.passwordElement.value;
- this.submitButton.disabled = this.passwordElement.value.length <= 0;
- this.showError = false;
+ this.updateInput_();
},
/**
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698