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 /** |
11 * @typedef {{ | 11 * @typedef {{ |
12 * extractable: boolean, | |
13 * id: string, | |
14 * name: string, | |
15 * policy: boolean, | |
16 * readonly: boolean, | |
17 * untrusted: boolean, | |
18 * }} | |
19 * @see chrome/browser/ui/webui/settings/certificates_handler.cc | |
20 */ | |
21 var CertificateSubnode; | |
22 | |
23 /** | |
24 * A data structure describing a certificate that is currently being imported, | |
25 * therefore it has no ID yet, but it has a name. Used within JS only. | |
26 * @typedef {{ | |
27 * name: string, | |
28 * }} | |
29 */ | |
30 var NewCertificateSubNode; | |
31 | |
32 /** | |
33 * @typedef {{ | |
34 * id: string, | 12 * id: string, |
35 * name: string, | 13 * name: string, |
36 * subnodes: !Array<!CertificateSubnode> | 14 * subnodes: !Array<!CertificateSubnode> |
37 * }} | 15 * }} |
38 * @see chrome/browser/ui/webui/settings/certificates_handler.cc | 16 * @see chrome/browser/ui/webui/settings/certificates_handler.cc |
39 */ | 17 */ |
40 var Certificate; | 18 var Certificate; |
dpapad
2016/06/29 22:28:41
Some of the typedefs are moved to the new file and
dschuyler
2016/06/30 17:13:32
It was only done as needed to compile. I've moved
| |
41 | 19 |
42 /** | 20 /** |
43 * @typedef {{ | 21 * @typedef {{ |
44 * ssl: boolean, | 22 * ssl: boolean, |
45 * email: boolean, | 23 * email: boolean, |
46 * objSign: boolean | 24 * objSign: boolean |
47 * }} | 25 * }} |
48 */ | 26 */ |
49 var CaTrustInfo; | 27 var CaTrustInfo; |
50 | 28 |
51 /** | 29 /** |
52 * Generic error returned from C++ via a Promise reject callback. | 30 * Generic error returned from C++ via a Promise reject callback. |
53 * @typedef {{ | 31 * @typedef {{ |
54 * title: string, | 32 * title: string, |
55 * description: string | 33 * description: string |
56 * }} | 34 * }} |
57 * @see chrome/browser/ui/webui/settings/certificates_handler.cc | 35 * @see chrome/browser/ui/webui/settings/certificates_handler.cc |
58 */ | 36 */ |
59 var CertificatesError; | 37 var CertificatesError; |
60 | 38 |
61 | 39 |
62 /** | 40 /** |
63 * Error returned from C++ via a Promise reject callback, when some certificates | 41 * Error returned from C++ via a Promise reject callback, when some certificates |
64 * fail to be imported. | 42 * fail to be imported. |
65 * @typedef {{ | 43 * @typedef {{ |
66 * title: string, | 44 * title: string, |
67 * description: string | 45 * description: string, |
68 * certificateErrors: !Array<{name: string, error: string}> | 46 * certificateErrors: !Array<{name: string, error: string}> |
69 * }} | 47 * }} |
70 * @see chrome/browser/ui/webui/settings/certificates_handler.cc | 48 * @see chrome/browser/ui/webui/settings/certificates_handler.cc |
71 */ | 49 */ |
72 var CertificatesImportError; | 50 var CertificatesImportError; |
73 | 51 |
74 cr.define('settings', function() { | 52 cr.define('settings', function() { |
75 /** | |
76 * Enumeration of all possible certificate types. | |
77 * @enum {string} | |
78 */ | |
79 var CertificateType = { | |
80 CA: 'ca', | |
81 OTHER: 'other', | |
82 PERSONAL: 'personal', | |
83 SERVER: 'server', | |
84 }; | |
85 | 53 |
86 /** @interface */ | 54 /** @interface */ |
87 function CertificatesBrowserProxy() {} | 55 function CertificatesBrowserProxy() {} |
88 | 56 |
89 CertificatesBrowserProxy.prototype = { | 57 CertificatesBrowserProxy.prototype = { |
90 /** | 58 /** |
91 * Triggers 5 events in the following order | 59 * Triggers 5 events in the following order |
92 * 1x 'certificates-model-ready' event. | 60 * 1x 'certificates-model-ready' event. |
93 * 4x 'certificates-changed' event, one for each certificate category. | 61 * 4x 'certificates-changed' event, one for each certificate category. |
94 */ | 62 */ |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 return cr.sendWithPromise('importCaCertificate'); | 230 return cr.sendWithPromise('importCaCertificate'); |
263 }, | 231 }, |
264 | 232 |
265 /** @override */ | 233 /** @override */ |
266 importServerCertificate: function() { | 234 importServerCertificate: function() { |
267 return cr.sendWithPromise('importServerCertificate'); | 235 return cr.sendWithPromise('importServerCertificate'); |
268 }, | 236 }, |
269 }; | 237 }; |
270 | 238 |
271 return { | 239 return { |
240 CertificatesBrowserProxy: CertificatesBrowserProxy, | |
272 CertificatesBrowserProxyImpl: CertificatesBrowserProxyImpl, | 241 CertificatesBrowserProxyImpl: CertificatesBrowserProxyImpl, |
273 CertificateType: CertificateType, | |
274 }; | 242 }; |
275 }); | 243 }); |
OLD | NEW |