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

Unified Diff: chrome/browser/resources/settings/people_page/password_prompt_dialog.js

Issue 2277993002: Small fixes for the lock screen md-settings page. (Closed)
Patch Set: Address comments Created 4 years, 4 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
Index: chrome/browser/resources/settings/people_page/password_prompt_dialog.js
diff --git a/chrome/browser/resources/settings/people_page/password_prompt_dialog.js b/chrome/browser/resources/settings/people_page/password_prompt_dialog.js
index 944be300729a55d39fbc942c1d744a90b2e80790..415b33887fbb9bef90d2012f28a26431ff0b6fce 100644
--- a/chrome/browser/resources/settings/people_page/password_prompt_dialog.js
+++ b/chrome/browser/resources/settings/people_page/password_prompt_dialog.js
@@ -90,32 +90,37 @@ Polymer({
return;
}
+ if (this.$.dialog.open)
+ return;
+
this.$.dialog.showModal();
},
- /** Close the dialog. */
- close: function() {
+ /** @private */
+ onCancelTap_: function() {
if (this.$.dialog.open)
this.$.dialog.close();
+ },
+ /**
+ * Called whenever the dialog is closed.
+ * @private
+ */
+ onClose_: function() {
this.password_ = '';
},
- /** Cancel the password prompt. */
- cancel: function() {
- if (this.$.dialog.open)
- this.$.dialog.cancel();
-
- // We bind setModes_ in an on-change event, so when the user hits cancel
- // after they enter their valid password we may have authenticated them.
- this.setModes_ = undefined;
+ /** @private */
+ onKeydown_: function(e) {
+ if (e.key == 'Enter')
+ this.submitPassword_();
},
/**
* Run the account password check.
* @private
*/
- checkPassword_: function() {
+ submitPassword_: function() {
clearTimeout(this.clearAccountPasswordTimeout_);
// The user might have started entering a password and then deleted it all.
@@ -150,7 +155,8 @@ Polymer({
this.clearAccountPasswordTimeout_ = setTimeout(
clearSetModes.bind(this), PASSWORD_ACTIVE_DURATION_MS);
- this.close();
+ // Closing the dialog will clear this.password_.
+ this.$.dialog.close();
}
}

Powered by Google App Engine
This is Rietveld 408576698