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

Side by Side Diff: chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.js

Issue 2792663002: MD Settings: Restore focus after closing dialogs, for certificate page. (Closed)
Patch Set: Add better explanation for |anchor| parameter in openDialog_ Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview A dialog prompting the user to encrypt a personal certificate 6 * @fileoverview A dialog prompting the user to encrypt a personal certificate
7 * before it is exported to disk. 7 * before it is exported to disk.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-certificate-password-encryption-dialog', 10 is: 'settings-certificate-password-encryption-dialog',
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 /** @private */ 47 /** @private */
48 onOkTap_: function() { 48 onOkTap_: function() {
49 this.browserProxy_.exportPersonalCertificatePasswordSelected( 49 this.browserProxy_.exportPersonalCertificatePasswordSelected(
50 this.password_).then( 50 this.password_).then(
51 function() { 51 function() {
52 this.$.dialog.close(); 52 this.$.dialog.close();
53 }.bind(this), 53 }.bind(this),
54 /** @param {!CertificatesError} error */ 54 /** @param {!CertificatesError} error */
55 function(error) { 55 function(error) {
56 this.$.dialog.close(); 56 this.$.dialog.close();
57 this.fire('certificates-error', error); 57 this.fire('certificates-error', {error: error, anchor: null});
58 }.bind(this)); 58 }.bind(this));
59 }, 59 },
60 60
61 /** 61 /**
62 * @param {!KeyboardEvent} e 62 * @param {!KeyboardEvent} e
63 * @private 63 * @private
64 */ 64 */
65 onKeypress_: function(e) { 65 onKeypress_: function(e) {
66 if (e.key == 'Enter' && !this.$.ok.disabled) 66 if (e.key == 'Enter' && !this.$.ok.disabled)
67 this.onOkTap_(); 67 this.onOkTap_();
68 }, 68 },
69 69
70 /** @private */ 70 /** @private */
71 validate_: function() { 71 validate_: function() {
72 var isValid = this.password_ != '' && 72 var isValid = this.password_ != '' &&
73 this.password_ == this.confirmPassword_; 73 this.password_ == this.confirmPassword_;
74 this.$.ok.disabled = !isValid; 74 this.$.ok.disabled = !isValid;
75 }, 75 },
76 }); 76 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698