OLD | NEW |
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 confirmation dialog allowing the user to delete various types | 6 * @fileoverview A confirmation dialog allowing the user to delete various types |
7 * of certificates. | 7 * of certificates. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-certificate-delete-confirmation-dialog', | 10 is: 'settings-certificate-delete-confirmation-dialog', |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 /** | 33 /** |
34 * @private | 34 * @private |
35 * @return {string} | 35 * @return {string} |
36 */ | 36 */ |
37 getTitleText_: function() { | 37 getTitleText_: function() { |
38 /** | 38 /** |
39 * @param {string} localizedMessageId | 39 * @param {string} localizedMessageId |
40 * @return {string} | 40 * @return {string} |
41 */ | 41 */ |
42 var getString = function(localizedMessageId) { | 42 var getString = localizedMessageId => |
43 return loadTimeData.getStringF(localizedMessageId, this.model.name); | 43 loadTimeData.getStringF(localizedMessageId, this.model.name); |
44 }.bind(this); | |
45 | 44 |
46 switch (this.certificateType) { | 45 switch (this.certificateType) { |
47 case CertificateType.PERSONAL: | 46 case CertificateType.PERSONAL: |
48 return getString('certificateManagerDeleteUserTitle'); | 47 return getString('certificateManagerDeleteUserTitle'); |
49 case CertificateType.SERVER: | 48 case CertificateType.SERVER: |
50 return getString('certificateManagerDeleteServerTitle'); | 49 return getString('certificateManagerDeleteServerTitle'); |
51 case CertificateType.CA: | 50 case CertificateType.CA: |
52 return getString('certificateManagerDeleteCaTitle'); | 51 return getString('certificateManagerDeleteCaTitle'); |
53 case CertificateType.OTHER: | 52 case CertificateType.OTHER: |
54 return getString('certificateManagerDeleteOtherTitle'); | 53 return getString('certificateManagerDeleteOtherTitle'); |
(...skipping 22 matching lines...) Expand all Loading... |
77 | 76 |
78 /** @private */ | 77 /** @private */ |
79 onCancelTap_: function() { | 78 onCancelTap_: function() { |
80 /** @type {!CrDialogElement} */ (this.$.dialog).close(); | 79 /** @type {!CrDialogElement} */ (this.$.dialog).close(); |
81 }, | 80 }, |
82 | 81 |
83 /** @private */ | 82 /** @private */ |
84 onOkTap_: function() { | 83 onOkTap_: function() { |
85 this.browserProxy_.deleteCertificate(this.model.id) | 84 this.browserProxy_.deleteCertificate(this.model.id) |
86 .then( | 85 .then( |
87 function() { | 86 () => { |
88 /** @type {!CrDialogElement} */ (this.$.dialog).close(); | 87 /** @type {!CrDialogElement} */ (this.$.dialog).close(); |
89 }.bind(this), | 88 }, |
90 /** @param {!CertificatesError} error */ | 89 error => { |
91 function(error) { | |
92 /** @type {!CrDialogElement} */ (this.$.dialog).close(); | 90 /** @type {!CrDialogElement} */ (this.$.dialog).close(); |
93 this.fire('certificates-error', {error: error, anchor: null}); | 91 this.fire('certificates-error', {error: error, anchor: null}); |
94 }.bind(this)); | 92 }); |
95 }, | 93 }, |
96 }); | 94 }); |
OLD | NEW |