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).then( | 110 this.browserProxy_.exportPersonalCertificate(this.model.id) |
111 function() { | 111 .then(function() { |
112 this.dispatchCertificateActionEvent_( | 112 this.dispatchCertificateActionEvent_( |
113 CertificateAction.EXPORT_PERSONAL); | 113 CertificateAction.EXPORT_PERSONAL); |
114 }.bind(this), | 114 }.bind(this), this.onRejected_.bind(this)); |
115 this.onRejected_.bind(this)); | |
116 } else { | 115 } else { |
117 this.browserProxy_.exportCertificate(this.model.id); | 116 this.browserProxy_.exportCertificate(this.model.id); |
118 } | 117 } |
119 }, | 118 }, |
120 | 119 |
121 /** | 120 /** |
122 * @param {!CertificateType} certificateType | 121 * @param {!CertificateType} certificateType |
123 * @param {!CertificateSubnode} model | 122 * @param {!CertificateSubnode} model |
124 * @return {boolean} Whether the certificate can be edited. | 123 * @return {boolean} Whether the certificate can be edited. |
125 * @private | 124 * @private |
(...skipping 24 matching lines...) Expand all Loading... |
150 return !model.readonly && !model.policy; | 149 return !model.readonly && !model.policy; |
151 }, | 150 }, |
152 | 151 |
153 /** @private */ | 152 /** @private */ |
154 closePopupMenu_: function() { | 153 closePopupMenu_: function() { |
155 this.$$('dialog[is=cr-action-menu]').close(); | 154 this.$$('dialog[is=cr-action-menu]').close(); |
156 }, | 155 }, |
157 | 156 |
158 /** @private */ | 157 /** @private */ |
159 onDotsTap_: function() { | 158 onDotsTap_: function() { |
160 var actionMenu = /** @type {!CrActionMenuElement} */( | 159 var actionMenu = /** @type {!CrActionMenuElement} */ (this.$.menu.get()); |
161 this.$.menu.get()); | |
162 actionMenu.showAt(this.$.dots); | 160 actionMenu.showAt(this.$.dots); |
163 }, | 161 }, |
164 }); | 162 }); |
OLD | NEW |