Chromium Code Reviews| 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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 791 var validFromString = new Date(1000 * certificateDetails.validFrom). toUTCString(); | 791 var validFromString = new Date(1000 * certificateDetails.validFrom). toUTCString(); |
| 792 var validUntilString = new Date(1000 * certificateDetails.validTo).t oUTCString(); | 792 var validUntilString = new Date(1000 * certificateDetails.validTo).t oUTCString(); |
| 793 | 793 |
| 794 var table = new WebInspector.SecurityDetailsTable(); | 794 var table = new WebInspector.SecurityDetailsTable(); |
| 795 certificateSection.appendChild(table.element()); | 795 certificateSection.appendChild(table.element()); |
| 796 table.addRow("Subject", certificateDetails.subject.name); | 796 table.addRow("Subject", certificateDetails.subject.name); |
| 797 table.addRow("SAN", sanDiv); | 797 table.addRow("SAN", sanDiv); |
| 798 table.addRow("Valid From", validFromString); | 798 table.addRow("Valid From", validFromString); |
| 799 table.addRow("Valid Until", validUntilString); | 799 table.addRow("Valid Until", validUntilString); |
| 800 table.addRow("Issuer", certificateDetails.issuer); | 800 table.addRow("Issuer", certificateDetails.issuer); |
| 801 table.addRow("SCTs", WebInspector.UIString(this.sctSummary(originSta te.securityDetails.certificateValidationDetails))); | |
| 801 table.addRow("", WebInspector.SecurityPanel.createCertificateViewerB utton(WebInspector.UIString("Open full certificate details"), originState.securi tyDetails.certificateId)); | 802 table.addRow("", WebInspector.SecurityPanel.createCertificateViewerB utton(WebInspector.UIString("Open full certificate details"), originState.securi tyDetails.certificateId)); |
| 802 // TODO(lgarron): Make SCT status available in certificate details a nd show it here. | |
| 803 } | 803 } |
| 804 | 804 |
| 805 function displayCertificateDetailsUnavailable () | 805 function displayCertificateDetailsUnavailable () |
| 806 { | 806 { |
| 807 certificateSection.createChild("div").textContent = WebInspector.UIS tring("Certificate details unavailable."); | 807 certificateSection.createChild("div").textContent = WebInspector.UIS tring("Certificate details unavailable."); |
| 808 } | 808 } |
| 809 | 809 |
| 810 originState.certificateDetailsPromise.then(displayCertificateDetails.bin d(this), displayCertificateDetailsUnavailable); | 810 originState.certificateDetailsPromise.then(displayCertificateDetails.bin d(this), displayCertificateDetailsUnavailable); |
| 811 | 811 |
| 812 var noteSection = this.element.createChild("div", "origin-view-section") ; | 812 var noteSection = this.element.createChild("div", "origin-view-section") ; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 872 setSecurityState: function(newSecurityState) | 872 setSecurityState: function(newSecurityState) |
| 873 { | 873 { |
| 874 for (var className of Array.prototype.slice.call(this._originLockIcon.cl assList)) { | 874 for (var className of Array.prototype.slice.call(this._originLockIcon.cl assList)) { |
| 875 if (className.startsWith("security-property-")) | 875 if (className.startsWith("security-property-")) |
| 876 this._originLockIcon.classList.remove(className); | 876 this._originLockIcon.classList.remove(className); |
| 877 } | 877 } |
| 878 | 878 |
| 879 this._originLockIcon.classList.add("security-property-" + newSecuritySta te); | 879 this._originLockIcon.classList.add("security-property-" + newSecuritySta te); |
| 880 }, | 880 }, |
| 881 | 881 |
| 882 /** | |
| 883 * @constructor | |
| 884 * @param {?NetworkAgent.CertificateValidationDetails} details | |
| 885 * @return {string} | |
| 886 */ | |
| 887 sctSummary: function(details) | |
| 888 { | |
| 889 if (!details) { | |
|
pfeldman
2016/02/01 23:01:11
drop {}
lgarron
2016/02/02 03:17:07
Done.
| |
| 890 return "N/A"; | |
|
pfeldman
2016/02/01 23:01:11
WebInspector.UIString()
lgarron
2016/02/02 03:17:07
Done. (I've also removed the WebInspector.UIString
| |
| 891 } | |
| 892 | |
| 893 var sctTypeList = []; | |
| 894 if (details.numValidScts) | |
| 895 sctTypeList.push(WebInspector.UIString("%d valid SCT%s", details.num ValidScts, (details.numValidScts > 1) ? "s" : "")); | |
| 896 if (details.numInvalidScts) | |
| 897 sctTypeList.push(WebInspector.UIString("%d invalid SCT%s", details.n umInvalidScts, (details.numInvalidScts > 1) ? "s" : "")); | |
| 898 if (details.numUnknownScts) | |
| 899 sctTypeList.push(WebInspector.UIString("%d SCT%s from unknown logs", details.numUnknownScts, (details.numUnknownScts > 1) ? "s" : "")); | |
| 900 return (sctTypeList.length == 0) ? WebInspector.UIString("0 SCTs") : sct TypeList.join(", "); | |
|
pfeldman
2016/02/01 23:01:11
sctTypeList.length ? ...
lgarron
2016/02/02 03:17:07
Done.
It still makes me uncomfortable, though, an
| |
| 901 }, | |
| 902 | |
| 882 __proto__: WebInspector.VBox.prototype | 903 __proto__: WebInspector.VBox.prototype |
| 883 } | 904 } |
| 884 | 905 |
| 885 /** | 906 /** |
| 886 * @constructor | 907 * @constructor |
| 887 */ | 908 */ |
| 888 WebInspector.SecurityDetailsTable = function() | 909 WebInspector.SecurityDetailsTable = function() |
| 889 { | 910 { |
| 890 this._element = createElement("table"); | 911 this._element = createElement("table"); |
| 891 this._element.classList.add("details-table"); | 912 this._element.classList.add("details-table"); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 911 row.createChild("div").textContent = key; | 932 row.createChild("div").textContent = key; |
| 912 | 933 |
| 913 var valueDiv = row.createChild("div"); | 934 var valueDiv = row.createChild("div"); |
| 914 if (typeof value === "string") { | 935 if (typeof value === "string") { |
| 915 valueDiv.textContent = value; | 936 valueDiv.textContent = value; |
| 916 } else { | 937 } else { |
| 917 valueDiv.appendChild(value); | 938 valueDiv.appendChild(value); |
| 918 } | 939 } |
| 919 } | 940 } |
| 920 } | 941 } |
| OLD | NEW |