| 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // Info explanations should appear after all others. | 606 // Info explanations should appear after all others. |
| 607 this._securityExplanationsMain = this.contentElement.createChild("div", "sec
urity-explanation-list"); | 607 this._securityExplanationsMain = this.contentElement.createChild("div", "sec
urity-explanation-list"); |
| 608 this._securityExplanationsExtra = this.contentElement.createChild("div", "se
curity-explanation-list security-explanations-extra"); | 608 this._securityExplanationsExtra = this.contentElement.createChild("div", "se
curity-explanation-list security-explanations-extra"); |
| 609 | 609 |
| 610 // Fill the security summary section. | 610 // Fill the security summary section. |
| 611 this._summarySection.createChild("div", "security-summary-section-title").te
xtContent = WebInspector.UIString("Security Overview"); | 611 this._summarySection.createChild("div", "security-summary-section-title").te
xtContent = WebInspector.UIString("Security Overview"); |
| 612 | 612 |
| 613 var lockSpectrum = this._summarySection.createChild("div", "lock-spectrum"); | 613 var lockSpectrum = this._summarySection.createChild("div", "lock-spectrum"); |
| 614 lockSpectrum.createChild("div", "lock-icon lock-icon-secure").title = WebIns
pector.UIString("Secure"); | 614 lockSpectrum.createChild("div", "lock-icon lock-icon-secure").title = WebIns
pector.UIString("Secure"); |
| 615 lockSpectrum.createChild("div", "lock-icon lock-icon-neutral").title = WebIn
spector.UIString("Not Secure"); | 615 lockSpectrum.createChild("div", "lock-icon lock-icon-neutral").title = WebIn
spector.UIString("Not Secure"); |
| 616 lockSpectrum.createChild("div", "lock-icon lock-icon-insecure").title = WebI
nspector.UIString("Insecure (Broken)"); | 616 lockSpectrum.createChild("div", "lock-icon lock-icon-insecure").title = WebI
nspector.UIString("Not Secure (Broken)"); |
| 617 | 617 |
| 618 this._summarySection.createChild("div", "triangle-pointer-container").create
Child("div", "triangle-pointer-wrapper").createChild("div", "triangle-pointer"); | 618 this._summarySection.createChild("div", "triangle-pointer-container").create
Child("div", "triangle-pointer-wrapper").createChild("div", "triangle-pointer"); |
| 619 | 619 |
| 620 this._summaryText = this._summarySection.createChild("div", "security-summar
y-text"); | 620 this._summaryText = this._summarySection.createChild("div", "security-summar
y-text"); |
| 621 } | 621 } |
| 622 | 622 |
| 623 WebInspector.SecurityMainView.prototype = { | 623 WebInspector.SecurityMainView.prototype = { |
| 624 /** | 624 /** |
| 625 * @param {!Element} parent | 625 * @param {!Element} parent |
| 626 * @param {!SecurityAgent.SecurityStateExplanation} explanation | 626 * @param {!SecurityAgent.SecurityStateExplanation} explanation |
| (...skipping 26 matching lines...) Expand all Loading... |
| 653 { | 653 { |
| 654 // Remove old state. | 654 // Remove old state. |
| 655 // It's safe to call this even when this._securityState is undefined. | 655 // It's safe to call this even when this._securityState is undefined. |
| 656 this._summarySection.classList.remove("security-summary-" + this._securi
tyState); | 656 this._summarySection.classList.remove("security-summary-" + this._securi
tyState); |
| 657 | 657 |
| 658 // Add new state. | 658 // Add new state. |
| 659 this._securityState = newSecurityState; | 659 this._securityState = newSecurityState; |
| 660 this._summarySection.classList.add("security-summary-" + this._securityS
tate); | 660 this._summarySection.classList.add("security-summary-" + this._securityS
tate); |
| 661 var summaryExplanationStrings = { | 661 var summaryExplanationStrings = { |
| 662 "unknown": WebInspector.UIString("The security of this page is unkn
own."), | 662 "unknown": WebInspector.UIString("The security of this page is unkn
own."), |
| 663 "insecure": WebInspector.UIString("This page is insecure (broken HTT
PS)."), | 663 "insecure": WebInspector.UIString("This page is not secure (broken H
TTPS)."), |
| 664 "neutral": WebInspector.UIString("This page is not secure."), | 664 "neutral": WebInspector.UIString("This page is not secure."), |
| 665 "secure": WebInspector.UIString("This page is secure (valid HTTPS)
.") | 665 "secure": WebInspector.UIString("This page is secure (valid HTTPS)
.") |
| 666 } | 666 } |
| 667 this._summaryText.textContent = summaryExplanationStrings[this._security
State]; | 667 this._summaryText.textContent = summaryExplanationStrings[this._security
State]; |
| 668 | 668 |
| 669 this._explanations = explanations, | 669 this._explanations = explanations, |
| 670 this._insecureContentStatus = insecureContentStatus; | 670 this._insecureContentStatus = insecureContentStatus; |
| 671 this._schemeIsCryptographic = schemeIsCryptographic; | 671 this._schemeIsCryptographic = schemeIsCryptographic; |
| 672 | 672 |
| 673 this._panel.setRanInsecureContentStyle(insecureContentStatus.ranInsecure
ContentStyle); | 673 this._panel.setRanInsecureContentStyle(insecureContentStatus.ranInsecure
ContentStyle); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 701 } | 701 } |
| 702 }, | 702 }, |
| 703 | 703 |
| 704 _addMixedContentExplanations: function() | 704 _addMixedContentExplanations: function() |
| 705 { | 705 { |
| 706 if (!this._schemeIsCryptographic) | 706 if (!this._schemeIsCryptographic) |
| 707 return; | 707 return; |
| 708 | 708 |
| 709 if (this._insecureContentStatus && (this._insecureContentStatus.ranMixed
Content || this._insecureContentStatus.displayedMixedContent)) { | 709 if (this._insecureContentStatus && (this._insecureContentStatus.ranMixed
Content || this._insecureContentStatus.displayedMixedContent)) { |
| 710 if (this._insecureContentStatus.ranMixedContent) | 710 if (this._insecureContentStatus.ranMixedContent) |
| 711 this._addMixedContentExplanation(this._securityExplanationsMain,
this._insecureContentStatus.ranInsecureContentStyle, WebInspector.UIString("Act
ive Mixed Content"), WebInspector.UIString("You have recently allowed insecure c
ontent (such as scripts or iframes) to run on this site."), WebInspector.Network
LogView.MixedContentFilterValues.BlockOverridden, showBlockOverriddenMixedConten
tInNetworkPanel); | 711 this._addMixedContentExplanation(this._securityExplanationsMain,
this._insecureContentStatus.ranInsecureContentStyle, WebInspector.UIString("Act
ive Mixed Content"), WebInspector.UIString("You have recently allowed non-secure
content (such as scripts or iframes) to run on this site."), WebInspector.Netwo
rkLogView.MixedContentFilterValues.BlockOverridden, showBlockOverriddenMixedCont
entInNetworkPanel); |
| 712 if (this._insecureContentStatus.displayedMixedContent) | 712 if (this._insecureContentStatus.displayedMixedContent) |
| 713 this._addMixedContentExplanation(this._securityExplanationsMain,
this._insecureContentStatus.displayedInsecureContentStyle, WebInspector.UIStrin
g("Mixed Content"), WebInspector.UIString("The site includes HTTP resources."),
WebInspector.NetworkLogView.MixedContentFilterValues.Displayed, showDisplayedMix
edContentInNetworkPanel); | 713 this._addMixedContentExplanation(this._securityExplanationsMain,
this._insecureContentStatus.displayedInsecureContentStyle, WebInspector.UIStrin
g("Mixed Content"), WebInspector.UIString("The site includes HTTP resources."),
WebInspector.NetworkLogView.MixedContentFilterValues.Displayed, showDisplayedMix
edContentInNetworkPanel); |
| 714 } | 714 } |
| 715 | 715 |
| 716 if (this._panel.filterRequestCount(WebInspector.NetworkLogView.MixedCont
entFilterValues.Blocked) > 0) | 716 if (this._panel.filterRequestCount(WebInspector.NetworkLogView.MixedCont
entFilterValues.Blocked) > 0) |
| 717 this._addMixedContentExplanation(this._securityExplanationsExtra, Se
curityAgent.SecurityState.Info, WebInspector.UIString("Blocked mixed content"),
WebInspector.UIString("Your page requested insecure resources that were blocked.
"), WebInspector.NetworkLogView.MixedContentFilterValues.Blocked, showBlockedMix
edContentInNetworkPanel); | 717 this._addMixedContentExplanation(this._securityExplanationsExtra, Se
curityAgent.SecurityState.Info, WebInspector.UIString("Blocked mixed content"),
WebInspector.UIString("Your page requested non-secure resources that were blocke
d."), WebInspector.NetworkLogView.MixedContentFilterValues.Blocked, showBlockedM
ixedContentInNetworkPanel); |
| 718 | 718 |
| 719 /** | 719 /** |
| 720 * @param {!Event} e | 720 * @param {!Event} e |
| 721 */ | 721 */ |
| 722 function showDisplayedMixedContentInNetworkPanel(e) | 722 function showDisplayedMixedContentInNetworkPanel(e) |
| 723 { | 723 { |
| 724 e.consume(); | 724 e.consume(); |
| 725 WebInspector.NetworkPanel.revealAndFilter([ | 725 WebInspector.NetworkPanel.revealAndFilter([ |
| 726 { | 726 { |
| 727 filterType: WebInspector.NetworkLogView.FilterType.MixedCont
ent, | 727 filterType: WebInspector.NetworkLogView.FilterType.MixedCont
ent, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 row.createChild("div").textContent = key; | 1041 row.createChild("div").textContent = key; |
| 1042 | 1042 |
| 1043 var valueDiv = row.createChild("div"); | 1043 var valueDiv = row.createChild("div"); |
| 1044 if (typeof value === "string") { | 1044 if (typeof value === "string") { |
| 1045 valueDiv.textContent = value; | 1045 valueDiv.textContent = value; |
| 1046 } else { | 1046 } else { |
| 1047 valueDiv.appendChild(value); | 1047 valueDiv.appendChild(value); |
| 1048 } | 1048 } |
| 1049 } | 1049 } |
| 1050 } | 1050 } |
| OLD | NEW |