| 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 settings-certificate-subentry represents an SSL certificate | 6 * @fileoverview settings-certificate-subentry represents an SSL certificate |
| 7 * sub-entry. | 7 * sub-entry. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 cr.define('settings', function() { | 10 cr.define('settings', function() { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 this.dispatchCertificateActionEvent_(CertificateAction.DELETE); | 100 this.dispatchCertificateActionEvent_(CertificateAction.DELETE); |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * @param {!Event} event | 104 * @param {!Event} event |
| 105 * @private | 105 * @private |
| 106 */ | 106 */ |
| 107 onExportTap_: function(event) { | 107 onExportTap_: function(event) { |
| 108 this.closePopupMenu_(); | 108 this.closePopupMenu_(); |
| 109 if (this.certificateType == CertificateType.PERSONAL) { | 109 if (this.certificateType == CertificateType.PERSONAL) { |
| 110 this.browserProxy_.exportPersonalCertificate(this.model.id) | 110 this.browserProxy_.exportPersonalCertificate(this.model.id).then(() => { |
| 111 .then(function() { | 111 this.dispatchCertificateActionEvent_(CertificateAction.EXPORT_PERSONAL); |
| 112 this.dispatchCertificateActionEvent_( | 112 }, this.onRejected_.bind(this)); |
| 113 CertificateAction.EXPORT_PERSONAL); | |
| 114 }.bind(this), this.onRejected_.bind(this)); | |
| 115 } else { | 113 } else { |
| 116 this.browserProxy_.exportCertificate(this.model.id); | 114 this.browserProxy_.exportCertificate(this.model.id); |
| 117 } | 115 } |
| 118 }, | 116 }, |
| 119 | 117 |
| 120 /** | 118 /** |
| 121 * @param {!CertificateType} certificateType | 119 * @param {!CertificateType} certificateType |
| 122 * @param {!CertificateSubnode} model | 120 * @param {!CertificateSubnode} model |
| 123 * @return {boolean} Whether the certificate can be edited. | 121 * @return {boolean} Whether the certificate can be edited. |
| 124 * @private | 122 * @private |
| (...skipping 28 matching lines...) Expand all Loading... |
| 153 closePopupMenu_: function() { | 151 closePopupMenu_: function() { |
| 154 this.$$('dialog[is=cr-action-menu]').close(); | 152 this.$$('dialog[is=cr-action-menu]').close(); |
| 155 }, | 153 }, |
| 156 | 154 |
| 157 /** @private */ | 155 /** @private */ |
| 158 onDotsTap_: function() { | 156 onDotsTap_: function() { |
| 159 var actionMenu = /** @type {!CrActionMenuElement} */ (this.$.menu.get()); | 157 var actionMenu = /** @type {!CrActionMenuElement} */ (this.$.menu.get()); |
| 160 actionMenu.showAt(this.$.dots); | 158 actionMenu.showAt(this.$.dots); |
| 161 }, | 159 }, |
| 162 }); | 160 }); |
| OLD | NEW |