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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 786 * @param {?NetworkAgent.CertificateDetails} certificateDetails | 786 * @param {?NetworkAgent.CertificateDetails} certificateDetails |
| 787 */ | 787 */ |
| 788 function displayCertificateDetails(certificateDetails) | 788 function displayCertificateDetails(certificateDetails) |
| 789 { | 789 { |
| 790 var sanDiv = this._createSanDiv(certificateDetails.subject); | 790 var sanDiv = this._createSanDiv(certificateDetails.subject); |
| 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); |
|
pfeldman
2016/02/04 00:16:15
These all should have WebInspector.UIString wrappe
| |
| 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", this.sctSummary(originState.securityDetails.cer tificateValidationDetails)); | |
| 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) | |
| 890 return WebInspector.UIString("N/A"); | |
| 891 | |
| 892 var sctTypeList = []; | |
| 893 if (details.numValidScts) | |
| 894 sctTypeList.push(WebInspector.UIString("%d valid SCT%s", details.num ValidScts, (details.numValidScts > 1) ? "s" : "")); | |
| 895 if (details.numInvalidScts) | |
| 896 sctTypeList.push(WebInspector.UIString("%d invalid SCT%s", details.n umInvalidScts, (details.numInvalidScts > 1) ? "s" : "")); | |
| 897 if (details.numUnknownScts) | |
| 898 sctTypeList.push(WebInspector.UIString("%d SCT%s from unknown logs", details.numUnknownScts, (details.numUnknownScts > 1) ? "s" : "")); | |
| 899 return sctTypeList.length ? sctTypeList.join(", ") : WebInspector.UIStri ng("0 SCTs"); | |
| 900 }, | |
| 901 | |
| 882 __proto__: WebInspector.VBox.prototype | 902 __proto__: WebInspector.VBox.prototype |
| 883 } | 903 } |
| 884 | 904 |
| 885 /** | 905 /** |
| 886 * @constructor | 906 * @constructor |
| 887 */ | 907 */ |
| 888 WebInspector.SecurityDetailsTable = function() | 908 WebInspector.SecurityDetailsTable = function() |
| 889 { | 909 { |
| 890 this._element = createElement("table"); | 910 this._element = createElement("table"); |
| 891 this._element.classList.add("details-table"); | 911 this._element.classList.add("details-table"); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 911 row.createChild("div").textContent = key; | 931 row.createChild("div").textContent = key; |
| 912 | 932 |
| 913 var valueDiv = row.createChild("div"); | 933 var valueDiv = row.createChild("div"); |
| 914 if (typeof value === "string") { | 934 if (typeof value === "string") { |
| 915 valueDiv.textContent = value; | 935 valueDiv.textContent = value; |
| 916 } else { | 936 } else { |
| 917 valueDiv.appendChild(value); | 937 valueDiv.appendChild(value); |
| 918 } | 938 } |
| 919 } | 939 } |
| 920 } | 940 } |
| OLD | NEW |