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