| 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 helper object used from the "Manage certificates" section | 6 * @fileoverview A helper object used from the "Manage certificates" section |
| 7 * to interact with the browser. | 7 * to interact with the browser. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 * @typedef {{ | 57 * @typedef {{ |
| 58 * title: string, | 58 * title: string, |
| 59 * description: string | 59 * description: string |
| 60 * certificateErrors: !Array<{certificateName: string, error: string}> | 60 * certificateErrors: !Array<{certificateName: string, error: string}> |
| 61 * }} | 61 * }} |
| 62 * @see chrome/browser/ui/webui/settings/certificates_handler.cc | 62 * @see chrome/browser/ui/webui/settings/certificates_handler.cc |
| 63 */ | 63 */ |
| 64 var CertificatesImportError; | 64 var CertificatesImportError; |
| 65 | 65 |
| 66 cr.define('settings', function() { | 66 cr.define('settings', function() { |
| 67 /** |
| 68 * Enumeration of all possible certificate types. |
| 69 * @enum {string} |
| 70 */ |
| 71 var CertificateType = { |
| 72 CA: 'ca', |
| 73 OTHER: 'other', |
| 74 PERSONAL: 'personal', |
| 75 SERVER: 'server', |
| 76 }; |
| 77 |
| 67 /** @interface */ | 78 /** @interface */ |
| 68 function CertificatesBrowserProxy() {} | 79 function CertificatesBrowserProxy() {} |
| 69 | 80 |
| 70 CertificatesBrowserProxy.prototype = { | 81 CertificatesBrowserProxy.prototype = { |
| 71 /** | 82 /** |
| 72 * Triggers two events in the following order | 83 * Triggers two events in the following order |
| 73 * 1) 'certificates-model-ready' event. | 84 * 1) 'certificates-model-ready' event. |
| 74 * 2) 'certificates-changed' event. | 85 * 2) 'certificates-changed' event. |
| 75 */ | 86 */ |
| 76 refreshCertificates: function() {}, | 87 refreshCertificates: function() {}, |
| 77 | 88 |
| 78 /** @param {string} id */ | 89 /** @param {string} id */ |
| 79 viewCertificate: function(id) {}, | 90 viewCertificate: function(id) {}, |
| 80 | 91 |
| 81 /** @param {string} id */ | 92 /** @param {string} id */ |
| 82 exportCertificate: function(id) {}, | 93 exportCertificate: function(id) {}, |
| 83 | 94 |
| 84 /** | 95 /** |
| 85 * @param {string} id | 96 * @param {string} id |
| 86 * @return {!Promise} | 97 * @return {!Promise} A promise resolved when the certificate has been |
| 98 * deleted successfully or rejected with a CertificatesError. |
| 87 */ | 99 */ |
| 88 deleteCertificate: function(id) {}, | 100 deleteCertificate: function(id) {}, |
| 89 | 101 |
| 90 /** | 102 /** |
| 91 * @param {string} id | 103 * @param {string} id |
| 92 * @return {!Promise<!CaTrustInfo>} | 104 * @return {!Promise<!CaTrustInfo>} |
| 93 */ | 105 */ |
| 94 getCaCertificateTrust: function(id) {}, | 106 getCaCertificateTrust: function(id) {}, |
| 95 | 107 |
| 96 /** | 108 /** |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 }, | 255 }, |
| 244 | 256 |
| 245 /** @override */ | 257 /** @override */ |
| 246 importServerCertificate: function() { | 258 importServerCertificate: function() { |
| 247 return cr.sendWithPromise('importServerCertificate'); | 259 return cr.sendWithPromise('importServerCertificate'); |
| 248 }, | 260 }, |
| 249 }; | 261 }; |
| 250 | 262 |
| 251 return { | 263 return { |
| 252 CertificatesBrowserProxyImpl: CertificatesBrowserProxyImpl, | 264 CertificatesBrowserProxyImpl: CertificatesBrowserProxyImpl, |
| 265 CertificateType: CertificateType, |
| 253 }; | 266 }; |
| 254 }); | 267 }); |
| OLD | NEW |