| 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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 this.element.classList.add("security-origin-view"); | 736 this.element.classList.add("security-origin-view"); |
| 737 this.registerRequiredCSS("security/originView.css"); | 737 this.registerRequiredCSS("security/originView.css"); |
| 738 this.registerRequiredCSS("security/lockIcon.css"); | 738 this.registerRequiredCSS("security/lockIcon.css"); |
| 739 | 739 |
| 740 var titleSection = this.element.createChild("div", "title-section"); | 740 var titleSection = this.element.createChild("div", "title-section"); |
| 741 var originDisplay = titleSection.createChild("div", "origin-display"); | 741 var originDisplay = titleSection.createChild("div", "origin-display"); |
| 742 this._originLockIcon = originDisplay.createChild("span", "security-property"
); | 742 this._originLockIcon = originDisplay.createChild("span", "security-property"
); |
| 743 this._originLockIcon.classList.add("security-property-" + originState.securi
tyState); | 743 this._originLockIcon.classList.add("security-property-" + originState.securi
tyState); |
| 744 // TODO(lgarron): Highlight the origin scheme. https://crbug.com/523589 | 744 // TODO(lgarron): Highlight the origin scheme. https://crbug.com/523589 |
| 745 originDisplay.createChild("span", "origin").textContent = origin; | 745 originDisplay.createChild("span", "origin").textContent = origin; |
| 746 var originNetworkLink = titleSection.createChild("div", "link"); | 746 var originNetworkButton = titleSection.createChild("button", "network-button
"); |
| 747 originNetworkLink.textContent = WebInspector.UIString("View requests in Netw
ork Panel"); | 747 originNetworkButton.textContent = WebInspector.UIString("View requests in Ne
twork Panel"); |
| 748 function showOriginRequestsInNetworkPanel() | 748 function showOriginRequestsInNetworkPanel() |
| 749 { | 749 { |
| 750 var parsedURL = new WebInspector.ParsedURL(origin); | 750 var parsedURL = new WebInspector.ParsedURL(origin); |
| 751 WebInspector.NetworkPanel.revealAndFilter([ | 751 WebInspector.NetworkPanel.revealAndFilter([ |
| 752 { | 752 { |
| 753 filterType: WebInspector.NetworkLogView.FilterType.Domain, | 753 filterType: WebInspector.NetworkLogView.FilterType.Domain, |
| 754 filterValue: parsedURL.host | 754 filterValue: parsedURL.host |
| 755 }, | 755 }, |
| 756 { | 756 { |
| 757 filterType: WebInspector.NetworkLogView.FilterType.Scheme, | 757 filterType: WebInspector.NetworkLogView.FilterType.Scheme, |
| 758 filterValue: parsedURL.scheme | 758 filterValue: parsedURL.scheme |
| 759 } | 759 } |
| 760 ]); | 760 ]); |
| 761 } | 761 } |
| 762 originNetworkLink.addEventListener("click", showOriginRequestsInNetworkPanel
, false); | 762 originNetworkButton.addEventListener("click", showOriginRequestsInNetworkPan
el, false); |
| 763 | 763 |
| 764 | 764 |
| 765 if (originState.securityDetails) { | 765 if (originState.securityDetails) { |
| 766 var connectionSection = this.element.createChild("div", "origin-view-sec
tion"); | 766 var connectionSection = this.element.createChild("div", "origin-view-sec
tion"); |
| 767 connectionSection.createChild("div", "origin-view-section-title").textCo
ntent = WebInspector.UIString("Connection"); | 767 connectionSection.createChild("div", "origin-view-section-title").textCo
ntent = WebInspector.UIString("Connection"); |
| 768 | 768 |
| 769 var table = new WebInspector.SecurityDetailsTable(); | 769 var table = new WebInspector.SecurityDetailsTable(); |
| 770 connectionSection.appendChild(table.element()); | 770 connectionSection.appendChild(table.element()); |
| 771 table.addRow("Protocol", originState.securityDetails.protocol); | 771 table.addRow("Protocol", originState.securityDetails.protocol); |
| 772 table.addRow("Key Exchange", originState.securityDetails.keyExchange); | 772 table.addRow("Key Exchange", originState.securityDetails.keyExchange); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 toggleSctsDetailsLink.addEventListener("click", toggleSctDetailsDisp
lay, false); | 849 toggleSctsDetailsLink.addEventListener("click", toggleSctDetailsDisp
lay, false); |
| 850 } | 850 } |
| 851 | 851 |
| 852 function displayCertificateDetailsUnavailable() | 852 function displayCertificateDetailsUnavailable() |
| 853 { | 853 { |
| 854 certificateSection.createChild("div").textContent = WebInspector.UIS
tring("Certificate details unavailable."); | 854 certificateSection.createChild("div").textContent = WebInspector.UIS
tring("Certificate details unavailable."); |
| 855 } | 855 } |
| 856 | 856 |
| 857 originState.certificateDetailsPromise.then(displayCertificateDetails.bin
d(this), displayCertificateDetailsUnavailable); | 857 originState.certificateDetailsPromise.then(displayCertificateDetails.bin
d(this), displayCertificateDetailsUnavailable); |
| 858 | 858 |
| 859 var noteSection = this.element.createChild("div", "origin-view-section")
; | 859 var noteSection = this.element.createChild("div", "origin-view-section f
irst-inspected-response"); |
| 860 // TODO(lgarron): Fix the issue and then remove this section. See commen
t in SecurityPanel._processRequest(). | 860 // TODO(lgarron): Fix the issue and then remove this section. See commen
t in SecurityPanel._processRequest(). |
| 861 noteSection.createChild("div").textContent = WebInspector.UIString("The
security details above are from the first inspected response."); | 861 noteSection.createChild("div").textContent = WebInspector.UIString("The
security details above are from the first inspected response."); |
| 862 } else if (originState.securityState !== SecurityAgent.SecurityState.Unknown
) { | 862 } else if (originState.securityState !== SecurityAgent.SecurityState.Unknown
) { |
| 863 var notSecureSection = this.element.createChild("div", "origin-view-sect
ion"); | 863 var notSecureSection = this.element.createChild("div", "origin-view-sect
ion"); |
| 864 notSecureSection.createChild("div", "origin-view-section-title").textCon
tent = WebInspector.UIString("Not Secure"); | 864 notSecureSection.createChild("div", "origin-view-section-title").textCon
tent = WebInspector.UIString("Not Secure"); |
| 865 notSecureSection.createChild("div").textContent = WebInspector.UIString(
"Your connection to this origin is not secure."); | 865 notSecureSection.createChild("div").textContent = WebInspector.UIString(
"Your connection to this origin is not secure."); |
| 866 } else { | 866 } else { |
| 867 var noInfoSection = this.element.createChild("div", "origin-view-section
"); | 867 var noInfoSection = this.element.createChild("div", "origin-view-section
"); |
| 868 noInfoSection.createChild("div", "origin-view-section-title").textConten
t = WebInspector.UIString("No Security Information"); | 868 noInfoSection.createChild("div", "origin-view-section-title").textConten
t = WebInspector.UIString("No Security Information"); |
| 869 noInfoSection.createChild("div").textContent = WebInspector.UIString("No
security details are available for this origin."); | 869 noInfoSection.createChild("div").textContent = WebInspector.UIString("No
security details are available for this origin."); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 row.createChild("div").textContent = key; | 958 row.createChild("div").textContent = key; |
| 959 | 959 |
| 960 var valueDiv = row.createChild("div"); | 960 var valueDiv = row.createChild("div"); |
| 961 if (typeof value === "string") { | 961 if (typeof value === "string") { |
| 962 valueDiv.textContent = value; | 962 valueDiv.textContent = value; |
| 963 } else { | 963 } else { |
| 964 valueDiv.appendChild(value); | 964 valueDiv.appendChild(value); |
| 965 } | 965 } |
| 966 } | 966 } |
| 967 } | 967 } |
| OLD | NEW |