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 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.PanelWithSidebar} | 7 * @extends {WebInspector.PanelWithSidebar} |
8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
9 */ | 9 */ |
10 WebInspector.SecurityPanel = function() | 10 WebInspector.SecurityPanel = function() |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 /** | 220 /** |
221 * @param {!WebInspector.NetworkLogView.MixedContentFilterValues} filterKey | 221 * @param {!WebInspector.NetworkLogView.MixedContentFilterValues} filterKey |
222 * @return {number} | 222 * @return {number} |
223 */ | 223 */ |
224 filterRequestCount: function(filterKey) | 224 filterRequestCount: function(filterKey) |
225 { | 225 { |
226 return this._filterRequestCounts.get(filterKey) || 0; | 226 return this._filterRequestCounts.get(filterKey) || 0; |
227 }, | 227 }, |
228 | 228 |
229 /** | 229 showCertificateViewer: function() |
230 * @param {!SecurityAgent.CertificateId} certificateId | |
231 */ | |
232 showCertificateViewer: function(certificateId) | |
233 { | 230 { |
234 var securityModel = WebInspector.SecurityModel.fromTarget(this._target); | 231 var securityModel = WebInspector.SecurityModel.fromTarget(this._target); |
235 securityModel.showCertificateViewer(certificateId); | 232 securityModel.showCertificateViewer(); |
236 }, | 233 }, |
237 | 234 |
238 /** | 235 /** |
239 * @param {!SecurityAgent.SecurityState} stateA | 236 * @param {!SecurityAgent.SecurityState} stateA |
240 * @param {!SecurityAgent.SecurityState} stateB | 237 * @param {!SecurityAgent.SecurityState} stateB |
241 * @return {!SecurityAgent.SecurityState} | 238 * @return {!SecurityAgent.SecurityState} |
242 */ | 239 */ |
243 _securityStateMin: function(stateA, stateB) | 240 _securityStateMin: function(stateA, stateB) |
244 { | 241 { |
245 return WebInspector.SecurityModel.SecurityStateComparator(stateA, stateB
) < 0 ? stateA : stateB; | 242 return WebInspector.SecurityModel.SecurityStateComparator(stateA, stateB
) < 0 ? stateA : stateB; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 /** | 320 /** |
324 * @return {!WebInspector.SecurityPanel} | 321 * @return {!WebInspector.SecurityPanel} |
325 */ | 322 */ |
326 WebInspector.SecurityPanel._instance = function() | 323 WebInspector.SecurityPanel._instance = function() |
327 { | 324 { |
328 return /** @type {!WebInspector.SecurityPanel} */ (self.runtime.sharedInstan
ce(WebInspector.SecurityPanel)); | 325 return /** @type {!WebInspector.SecurityPanel} */ (self.runtime.sharedInstan
ce(WebInspector.SecurityPanel)); |
329 } | 326 } |
330 | 327 |
331 /** | 328 /** |
332 * @param {string} text | 329 * @param {string} text |
333 * @param {!SecurityAgent.CertificateId} certificateId | |
334 * @param {!WebInspector.SecurityPanel} panel | 330 * @param {!WebInspector.SecurityPanel} panel |
335 * @return {!Element} | 331 * @return {!Element} |
336 */ | 332 */ |
337 WebInspector.SecurityPanel.createCertificateViewerButton = function(text, certif
icateId, panel) | 333 WebInspector.SecurityPanel.createCertificateViewerButton = function(text, panel) |
338 { | 334 { |
339 /** | 335 /** |
340 * @param {!Event} e | 336 * @param {!Event} e |
341 */ | 337 */ |
342 function showCertificateViewer(e) | 338 function showCertificateViewer(e) |
343 { | 339 { |
344 e.consume(); | 340 e.consume(); |
345 panel.showCertificateViewer(certificateId); | 341 panel.showCertificateViewer(); |
346 } | 342 } |
347 | 343 |
348 return createTextButton(text, showCertificateViewer, "security-certificate-b
utton"); | 344 return createTextButton(text, showCertificateViewer, "security-certificate-b
utton"); |
349 } | 345 } |
350 | 346 |
351 /** | 347 /** |
352 * @param {string} text | 348 * @param {string} text |
353 * @param {string} origin | 349 * @param {string} origin |
354 * @return {!Element} | 350 * @return {!Element} |
355 */ | 351 */ |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 _addExplanation: function(parent, explanation) | 620 _addExplanation: function(parent, explanation) |
625 { | 621 { |
626 var explanationSection = parent.createChild("div", "security-explanation
"); | 622 var explanationSection = parent.createChild("div", "security-explanation
"); |
627 explanationSection.classList.add("security-explanation-" + explanation.s
ecurityState); | 623 explanationSection.classList.add("security-explanation-" + explanation.s
ecurityState); |
628 | 624 |
629 explanationSection.createChild("div", "security-property").classList.add
("security-property-" + explanation.securityState); | 625 explanationSection.createChild("div", "security-property").classList.add
("security-property-" + explanation.securityState); |
630 var text = explanationSection.createChild("div", "security-explanation-t
ext"); | 626 var text = explanationSection.createChild("div", "security-explanation-t
ext"); |
631 text.createChild("div", "security-explanation-title").textContent = expl
anation.summary; | 627 text.createChild("div", "security-explanation-title").textContent = expl
anation.summary; |
632 text.createChild("div").textContent = explanation.description; | 628 text.createChild("div").textContent = explanation.description; |
633 | 629 |
634 if (explanation.certificateId) { | 630 if (explanation.hasCertificate) { |
635 text.appendChild(WebInspector.SecurityPanel.createCertificateViewerB
utton(WebInspector.UIString("View certificate"), explanation.certificateId, this
._panel)); | 631 text.appendChild(WebInspector.SecurityPanel.createCertificateViewerB
utton(WebInspector.UIString("View certificate"), this._panel)); |
636 } | 632 } |
637 | 633 |
638 return text; | 634 return text; |
639 }, | 635 }, |
640 | 636 |
641 /** | 637 /** |
642 * @param {!SecurityAgent.SecurityState} newSecurityState | 638 * @param {!SecurityAgent.SecurityState} newSecurityState |
643 * @param {!Array<!SecurityAgent.SecurityStateExplanation>} explanations | 639 * @param {!Array<!SecurityAgent.SecurityStateExplanation>} explanations |
644 * @param {?SecurityAgent.InsecureContentStatus} insecureContentStatus | 640 * @param {?SecurityAgent.InsecureContentStatus} insecureContentStatus |
645 * @param {boolean} schemeIsCryptographic | 641 * @param {boolean} schemeIsCryptographic |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 row.createChild("div").textContent = key; | 1030 row.createChild("div").textContent = key; |
1035 | 1031 |
1036 var valueDiv = row.createChild("div"); | 1032 var valueDiv = row.createChild("div"); |
1037 if (typeof value === "string") { | 1033 if (typeof value === "string") { |
1038 valueDiv.textContent = value; | 1034 valueDiv.textContent = value; |
1039 } else { | 1035 } else { |
1040 valueDiv.appendChild(value); | 1036 valueDiv.appendChild(value); |
1041 } | 1037 } |
1042 } | 1038 } |
1043 } | 1039 } |
OLD | NEW |