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

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

Issue 2984843003: MD Settings: Convert all usages of .bind(this) to use ES6 arrow function. (Closed)
Patch Set: Resolve conflicts. Created 3 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 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 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
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698