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

Unified Diff: chrome/browser/resources/options/managed_user_set_passphrase.js

Issue 12613003: Update display after the passphrase input fields are reset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comment. Created 7 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/managed_user_set_passphrase.js
diff --git a/chrome/browser/resources/options/managed_user_set_passphrase.js b/chrome/browser/resources/options/managed_user_set_passphrase.js
index 930cfcc0523a26e8f9abf5661ff7ded4af67da91..bfb8502b8504d2ee84aaf1d8d6d30752c4ce2de0 100644
--- a/chrome/browser/resources/options/managed_user_set_passphrase.js
+++ b/chrome/browser/resources/options/managed_user_set_passphrase.js
@@ -22,24 +22,6 @@ cr.define('options', function() {
cr.addSingletonGetter(ManagedUserSetPassphraseOverlay);
- /** Closes the page and resets the passphrase fields */
- var closePage = function(container) {
- // Reseting the fields directly would lead to a flicker, so listen to
- // webkitTransitionEnd to clear them after that. Similar to how it is done
- // in setOverlayVisible_ in options_page.js.
- container.addEventListener('webkitTransitionEnd', function f(e) {
- if (e.target != e.currentTarget || e.propertyName != 'opacity')
- return;
- container.removeEventListener('webkitTransitionEnd', f);
-
- // Reset the fields.
- $('managed-user-passphrase').value = '';
- $('passphrase-confirm').value = '';
- $('passphrase-mismatch').hidden = true;
- });
- OptionsPage.closeOverlay();
- };
-
ManagedUserSetPassphraseOverlay.prototype = {
__proto__: OptionsPage.prototype,
@@ -71,7 +53,7 @@ cr.define('options', function() {
};
$('cancel-passphrase').onclick = function(event) {
- closePage(self.container);
+ self.closePage();
};
},
@@ -92,7 +74,7 @@ cr.define('options', function() {
*/
setPassphrase_: function(event) {
chrome.send('setPassphrase', [$('managed-user-passphrase').value]);
- closePage(this.container);
+ this.closePage();
},
/** @override */
@@ -110,7 +92,26 @@ cr.define('options', function() {
* Make sure that we reset the fields on cancel.
*/
handleCancel: function() {
- closePage(this.container);
+ this.closePage();
+ },
+
+ /** Closes the page and resets the passphrase fields */
+ closePage: function() {
+ // Reseting the fields directly would lead to a flicker, so listen to
+ // webkitTransitionEnd to clear them after that. Similar to how it is done
+ // in setOverlayVisible_ in options_page.js.
+ var self = this;
+ this.container.addEventListener('webkitTransitionEnd', function f(e) {
+ if (e.target != e.currentTarget || e.propertyName != 'opacity')
+ return;
+ self.container.removeEventListener('webkitTransitionEnd', f);
+
+ // Reset the fields.
+ $('managed-user-passphrase').value = '';
+ $('passphrase-confirm').value = '';
+ self.updateDisplay_();
+ });
+ OptionsPage.closeOverlay();
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698