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.SDKModel} | 7 * @extends {WebInspector.SDKModel} |
8 * @param {!WebInspector.Target} target | 8 * @param {!WebInspector.Target} target |
9 */ | 9 */ |
10 WebInspector.SecurityModel = function(target) | 10 WebInspector.SecurityModel = function(target) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 WebInspector.SecurityDispatcher.prototype = { | 58 WebInspector.SecurityDispatcher.prototype = { |
59 /** | 59 /** |
60 * @override | 60 * @override |
61 * @param {!SecurityAgent.SecurityState} securityState | 61 * @param {!SecurityAgent.SecurityState} securityState |
62 * @param {!Array<!SecurityAgent.SecurityStateExplanation>=} explanations | 62 * @param {!Array<!SecurityAgent.SecurityStateExplanation>=} explanations |
63 * @param {!SecurityAgent.MixedContentStatus=} mixedContentStatus | 63 * @param {!SecurityAgent.MixedContentStatus=} mixedContentStatus |
64 * @param {boolean=} schemeIsCryptographic | 64 * @param {boolean=} schemeIsCryptographic |
65 */ | 65 */ |
66 securityStateChanged: function(securityState, explanations, mixedContentStat us, schemeIsCryptographic) | 66 securityStateChanged: function(securityState, explanations, mixedContentStat us, schemeIsCryptographic) |
67 { | 67 { |
68 var data = {"securityState": securityState, "explanations": explanations || []}; | 68 var data = {"securityState": securityState, "explanations": explanations || [], "mixedContentStatus": mixedContentStatus, "schemeIsCryptographic": schem eIsCryptographic}; |
pfeldman
2015/09/03 23:48:48
It is always better to define a class / typedef it
estark
2015/09/04 02:45:30
Not sure if I did this right, PTAL.
| |
69 if (schemeIsCryptographic && mixedContentStatus) { | |
70 if (mixedContentStatus.ranInsecureContent) { | |
71 explanations.push({ | |
72 "securityState": mixedContentStatus.ranInsecureContentStyle, | |
73 "summary": WebInspector.UIString("Active Mixed Content"), | |
74 "description": WebInspector.UIString("You have recently allo wed insecure content (such as scripts or iframes) to run on this site.") | |
75 }); | |
76 } else if (mixedContentStatus.displayedInsecureContent) { | |
77 explanations.push({ | |
78 "securityState": mixedContentStatus.displayedInsecureContent Style, | |
79 "summary": WebInspector.UIString("Mixed Content"), | |
80 "description": WebInspector.UIString("The site includes HTTP resources.") | |
81 }); | |
82 } | |
83 } | |
84 this._model.dispatchEventToListeners(WebInspector.SecurityModel.EventTyp es.SecurityStateChanged, data); | 69 this._model.dispatchEventToListeners(WebInspector.SecurityModel.EventTyp es.SecurityStateChanged, data); |
85 } | 70 } |
86 } | 71 } |
OLD | NEW |