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 #include "content/browser/devtools/protocol/security_handler.h" | 5 #include "content/browser/devtools/protocol/security_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" | 9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
10 #include "content/public/browser/security_style_explanations.h" | 10 #include "content/public/browser/security_style_explanations.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 &explanations); | 101 &explanations); |
102 AddExplanations(kSecurityStateNeutral, | 102 AddExplanations(kSecurityStateNeutral, |
103 security_style_explanations.unauthenticated_explanations, | 103 security_style_explanations.unauthenticated_explanations, |
104 &explanations); | 104 &explanations); |
105 AddExplanations(kSecurityStateSecure, | 105 AddExplanations(kSecurityStateSecure, |
106 security_style_explanations.secure_explanations, | 106 security_style_explanations.secure_explanations, |
107 &explanations); | 107 &explanations); |
108 AddExplanations(kSecurityStateInfo, | 108 AddExplanations(kSecurityStateInfo, |
109 security_style_explanations.info_explanations, &explanations); | 109 security_style_explanations.info_explanations, &explanations); |
110 | 110 |
111 scoped_refptr<MixedContentStatus> mixed_content_status = | 111 scoped_refptr<InsecureContentStatus> insecure_content_status = |
112 MixedContentStatus::Create() | 112 InsecureContentStatus::Create() |
113 ->set_ran_insecure_content( | 113 ->set_ran_mixed_content(security_style_explanations.ran_mixed_content) |
114 security_style_explanations.ran_insecure_content) | 114 ->set_displayed_mixed_content( |
115 ->set_displayed_insecure_content( | 115 security_style_explanations.displayed_mixed_content) |
116 security_style_explanations.displayed_insecure_content) | 116 ->set_ran_content_with_cert_errors( |
| 117 security_style_explanations.ran_content_with_cert_errors) |
| 118 ->set_displayed_content_with_cert_errors( |
| 119 security_style_explanations.displayed_content_with_cert_errors) |
117 ->set_ran_insecure_content_style(SecurityStyleToProtocolSecurityState( | 120 ->set_ran_insecure_content_style(SecurityStyleToProtocolSecurityState( |
118 security_style_explanations.ran_insecure_content_style)) | 121 security_style_explanations.ran_insecure_content_style)) |
119 ->set_displayed_insecure_content_style( | 122 ->set_displayed_insecure_content_style( |
120 SecurityStyleToProtocolSecurityState( | 123 SecurityStyleToProtocolSecurityState( |
121 security_style_explanations | 124 security_style_explanations |
122 .displayed_insecure_content_style)); | 125 .displayed_insecure_content_style)); |
123 | 126 |
124 client_->SecurityStateChanged( | 127 client_->SecurityStateChanged( |
125 SecurityStateChangedParams::Create() | 128 SecurityStateChangedParams::Create() |
126 ->set_security_state(security_state) | 129 ->set_security_state(security_state) |
127 ->set_scheme_is_cryptographic( | 130 ->set_scheme_is_cryptographic( |
128 security_style_explanations.scheme_is_cryptographic) | 131 security_style_explanations.scheme_is_cryptographic) |
129 ->set_mixed_content_status(mixed_content_status) | 132 ->set_insecure_content_status(insecure_content_status) |
130 ->set_explanations(explanations)); | 133 ->set_explanations(explanations)); |
131 } | 134 } |
132 | 135 |
133 Response SecurityHandler::Enable() { | 136 Response SecurityHandler::Enable() { |
134 enabled_ = true; | 137 enabled_ = true; |
135 if (host_) | 138 if (host_) |
136 AttachToRenderFrameHost(); | 139 AttachToRenderFrameHost(); |
137 | 140 |
138 return Response::OK(); | 141 return Response::OK(); |
139 } | 142 } |
140 | 143 |
141 Response SecurityHandler::Disable() { | 144 Response SecurityHandler::Disable() { |
142 enabled_ = false; | 145 enabled_ = false; |
143 WebContentsObserver::Observe(nullptr); | 146 WebContentsObserver::Observe(nullptr); |
144 return Response::OK(); | 147 return Response::OK(); |
145 } | 148 } |
146 | 149 |
147 } // namespace security | 150 } // namespace security |
148 } // namespace devtools | 151 } // namespace devtools |
149 } // namespace content | 152 } // namespace content |
OLD | NEW |