Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js

Issue 2354873003: DevTools security panel: prompt user to reload for mixed requests (Closed)
Patch Set: add a test that includes active mixed content Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698