| 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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 * @param {!Function} networkFilterFn | 789 * @param {!Function} networkFilterFn |
| 790 */ | 790 */ |
| 791 _addMixedContentExplanation: function(parent, securityState, summary, descri
ption, filterKey, networkFilterFn) | 791 _addMixedContentExplanation: function(parent, securityState, summary, descri
ption, filterKey, networkFilterFn) |
| 792 { | 792 { |
| 793 var mixedContentExplanation = /** @type {!SecurityAgent.SecurityStateExp
lanation} */ ({ | 793 var mixedContentExplanation = /** @type {!SecurityAgent.SecurityStateExp
lanation} */ ({ |
| 794 "securityState": securityState, | 794 "securityState": securityState, |
| 795 "summary": summary, | 795 "summary": summary, |
| 796 "description": description | 796 "description": description |
| 797 }); | 797 }); |
| 798 | 798 |
| 799 var explanation = this._addExplanation(parent, mixedContentExplanation); |
| 800 |
| 799 var filterRequestCount = this._panel.filterRequestCount(filterKey); | 801 var filterRequestCount = this._panel.filterRequestCount(filterKey); |
| 800 var requestsAnchor = this._addExplanation(parent, mixedContentExplanatio
n).createChild("div", "security-mixed-content link"); | 802 if (!filterRequestCount) { |
| 801 if (filterRequestCount > 0) { | 803 // Network instrumentation might not have been enabled for the page |
| 802 requestsAnchor.textContent = WebInspector.UIString("View %d request%
s in Network Panel", filterRequestCount, (filterRequestCount > 1 ? "s" : "")); | 804 // load, so the security panel does not necessarily know a count of |
| 805 // individual mixed requests at this point. Prompt them to refresh |
| 806 // instead of pointing them to the Network panel to get prompted |
| 807 // to refresh. |
| 808 var refreshPrompt = explanation.createChild("div", "security-mixed-c
ontent"); |
| 809 refreshPrompt.textContent = WebInspector.UIString("Reload the page t
o record requests for HTTP resources."); |
| 810 return; |
| 811 } |
| 812 |
| 813 var requestsAnchor = explanation.createChild("div", "security-mixed-cont
ent link"); |
| 814 if (filterRequestCount === 1) { |
| 815 requestsAnchor.textContent = WebInspector.UIString("View %d request
in Network Panel", filterRequestCount); |
| 803 } else { | 816 } else { |
| 804 // Network instrumentation might not have been enabled for the page
load, so the security panel does not necessarily know a count of individual mixe
d requests at this point. Point the user at the Network Panel which prompts them
to refresh. | 817 requestsAnchor.textContent = WebInspector.UIString("View %d requests
in Network Panel", filterRequestCount); |
| 805 requestsAnchor.textContent = WebInspector.UIString("View requests in
Network Panel"); | |
| 806 } | 818 } |
| 807 requestsAnchor.href = ""; | 819 requestsAnchor.href = ""; |
| 808 requestsAnchor.addEventListener("click", networkFilterFn); | 820 requestsAnchor.addEventListener("click", networkFilterFn); |
| 809 }, | 821 }, |
| 810 | 822 |
| 811 _addContentWithCertErrorsExplanations: function() | 823 _addContentWithCertErrorsExplanations: function() |
| 812 { | 824 { |
| 813 if (!this._schemeIsCryptographic) | 825 if (!this._schemeIsCryptographic) |
| 814 return; | 826 return; |
| 815 | 827 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 row.createChild("div").textContent = key; | 1075 row.createChild("div").textContent = key; |
| 1064 | 1076 |
| 1065 var valueDiv = row.createChild("div"); | 1077 var valueDiv = row.createChild("div"); |
| 1066 if (typeof value === "string") { | 1078 if (typeof value === "string") { |
| 1067 valueDiv.textContent = value; | 1079 valueDiv.textContent = value; |
| 1068 } else { | 1080 } else { |
| 1069 valueDiv.appendChild(value); | 1081 valueDiv.appendChild(value); |
| 1070 } | 1082 } |
| 1071 } | 1083 } |
| 1072 } | 1084 } |
| OLD | NEW |