OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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-manager-page' is the settings page | 6 * @fileoverview 'settings-certificate-manager-page' is the settings page |
7 * containing SSL certificate settings. | 7 * containing SSL certificate settings. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-certificate-manager-page', | 10 is: 'settings-certificate-manager-page', |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 /** @type {!Array<!Certificate>} */ | 39 /** @type {!Array<!Certificate>} */ |
40 otherCerts: { | 40 otherCerts: { |
41 type: Array, | 41 type: Array, |
42 value: function() { return []; }, | 42 value: function() { return []; }, |
43 }, | 43 }, |
44 | 44 |
45 /** @private */ | 45 /** @private */ |
46 certificateTypeEnum_: { | 46 certificateTypeEnum_: { |
47 type: Object, | 47 type: Object, |
48 value: settings.CertificateType, | 48 value: CertificateType, |
49 readOnly: true, | 49 readOnly: true, |
50 }, | 50 }, |
51 | 51 |
52 /** @private */ | 52 /** @private */ |
53 showCaTrustEditDialog_: Boolean, | 53 showCaTrustEditDialog_: Boolean, |
54 | 54 |
55 /** @private */ | 55 /** @private */ |
56 showDeleteConfirmationDialog_: Boolean, | 56 showDeleteConfirmationDialog_: Boolean, |
57 | 57 |
58 /** @private */ | 58 /** @private */ |
59 showPasswordEncryptionDialog_: Boolean, | 59 showPasswordEncryptionDialog_: Boolean, |
60 | 60 |
61 /** @private */ | 61 /** @private */ |
62 showPasswordDecryptionDialog_: Boolean, | 62 showPasswordDecryptionDialog_: Boolean, |
63 | 63 |
64 /** @private */ | 64 /** @private */ |
65 showErrorDialog_: Boolean, | 65 showErrorDialog_: Boolean, |
66 | 66 |
67 /** | 67 /** |
68 * The model to be passed to dialogs that refer to a given certificate. | 68 * The model to be passed to dialogs that refer to a given certificate. |
69 * @private {?CertificateSubnode} | 69 * @private {?CertificateSubnode} |
70 */ | 70 */ |
71 dialogModel_: Object, | 71 dialogModel_: Object, |
72 | 72 |
73 /** | 73 /** |
74 * The certificate type to be passed to dialogs that refer to a given | 74 * The certificate type to be passed to dialogs that refer to a given |
75 * certificate. | 75 * certificate. |
76 * @private {?settings.CertificateType} | 76 * @private {?CertificateType} |
77 */ | 77 */ |
78 dialogModelCertificateType_: String, | 78 dialogModelCertificateType_: String, |
79 | 79 |
80 /** | 80 /** |
81 * The model to be passed to the error dialog. | 81 * The model to be passed to the error dialog. |
82 * @private {null|!CertificatesError|!CertificatesImportError} | 82 * @private {null|!CertificatesError|!CertificatesImportError} |
83 */ | 83 */ |
84 errorDialogModel_: Object, | 84 errorDialogModel_: Object, |
85 }, | 85 }, |
86 | 86 |
(...skipping 12 matching lines...) Expand all Loading... |
99 isTabSelected_: function(selectedIndex, tabIndex) { | 99 isTabSelected_: function(selectedIndex, tabIndex) { |
100 return selectedIndex == tabIndex; | 100 return selectedIndex == tabIndex; |
101 }, | 101 }, |
102 | 102 |
103 /** @override */ | 103 /** @override */ |
104 ready: function() { | 104 ready: function() { |
105 this.addEventListener(settings.CertificateActionEvent, function(event) { | 105 this.addEventListener(settings.CertificateActionEvent, function(event) { |
106 this.dialogModel_ = event.detail.subnode; | 106 this.dialogModel_ = event.detail.subnode; |
107 this.dialogModelCertificateType_ = event.detail.certificateType; | 107 this.dialogModelCertificateType_ = event.detail.certificateType; |
108 | 108 |
109 if (event.detail.action == settings.CertificateAction.IMPORT) { | 109 if (event.detail.action == CertificateAction.IMPORT) { |
110 if (event.detail.certificateType == settings.CertificateType.PERSONAL) { | 110 if (event.detail.certificateType == CertificateType.PERSONAL) { |
111 this.openDialog_( | 111 this.openDialog_( |
112 'settings-certificate-password-decryption-dialog', | 112 'settings-certificate-password-decryption-dialog', |
113 'showPasswordDecryptionDialog_'); | 113 'showPasswordDecryptionDialog_'); |
114 } else if (event.detail.certificateType == | 114 } else if (event.detail.certificateType == |
115 settings.CertificateType.CA) { | 115 CertificateType.CA) { |
116 this.openDialog_( | 116 this.openDialog_( |
117 'settings-ca-trust-edit-dialog', 'showCaTrustEditDialog_'); | 117 'settings-ca-trust-edit-dialog', 'showCaTrustEditDialog_'); |
118 } | 118 } |
119 } else { | 119 } else { |
120 if (event.detail.action == settings.CertificateAction.EDIT) { | 120 if (event.detail.action == CertificateAction.EDIT) { |
121 this.openDialog_( | 121 this.openDialog_( |
122 'settings-ca-trust-edit-dialog', 'showCaTrustEditDialog_'); | 122 'settings-ca-trust-edit-dialog', 'showCaTrustEditDialog_'); |
123 } else if (event.detail.action == settings.CertificateAction.DELETE) { | 123 } else if (event.detail.action == CertificateAction.DELETE) { |
124 this.openDialog_( | 124 this.openDialog_( |
125 'settings-certificate-delete-confirmation-dialog', | 125 'settings-certificate-delete-confirmation-dialog', |
126 'showDeleteConfirmationDialog_'); | 126 'showDeleteConfirmationDialog_'); |
127 } else if (event.detail.action == | 127 } else if (event.detail.action == |
128 settings.CertificateAction.EXPORT_PERSONAL) { | 128 CertificateAction.EXPORT_PERSONAL) { |
129 this.openDialog_( | 129 this.openDialog_( |
130 'settings-certificate-password-encryption-dialog', | 130 'settings-certificate-password-encryption-dialog', |
131 'showPasswordEncryptionDialog_'); | 131 'showPasswordEncryptionDialog_'); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 event.stopPropagation(); | 135 event.stopPropagation(); |
136 }.bind(this)); | 136 }.bind(this)); |
137 | 137 |
138 this.addEventListener('certificates-error', function(event) { | 138 this.addEventListener('certificates-error', function(event) { |
(...skipping 18 matching lines...) Expand all Loading... |
157 openDialog_: function(dialogTagName, domIfBooleanName) { | 157 openDialog_: function(dialogTagName, domIfBooleanName) { |
158 this.set(domIfBooleanName, true); | 158 this.set(domIfBooleanName, true); |
159 this.async(function() { | 159 this.async(function() { |
160 var dialog = this.$$(dialogTagName); | 160 var dialog = this.$$(dialogTagName); |
161 dialog.addEventListener('iron-overlay-closed', function() { | 161 dialog.addEventListener('iron-overlay-closed', function() { |
162 this.set(domIfBooleanName, false); | 162 this.set(domIfBooleanName, false); |
163 }.bind(this)); | 163 }.bind(this)); |
164 }.bind(this)); | 164 }.bind(this)); |
165 }, | 165 }, |
166 }); | 166 }); |
OLD | NEW |