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 "chrome/browser/ssl/security_state_tab_helper.h" | 5 #include "chrome/browser/ssl/security_state_tab_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 std::unique_ptr<security_state::VisibleSecurityState> | 196 std::unique_ptr<security_state::VisibleSecurityState> |
197 SecurityStateTabHelper::GetVisibleSecurityState() const { | 197 SecurityStateTabHelper::GetVisibleSecurityState() const { |
198 auto state = security_state::GetVisibleSecurityState(web_contents()); | 198 auto state = security_state::GetVisibleSecurityState(web_contents()); |
199 | 199 |
200 // Malware status might already be known even if connection security | 200 // Malware status might already be known even if connection security |
201 // information is still being initialized, thus no need to check for that. | 201 // information is still being initialized, thus no need to check for that. |
202 state->malicious_content_status = GetMaliciousContentStatus(); | 202 state->malicious_content_status = GetMaliciousContentStatus(); |
203 | 203 |
204 // If the chain contains SHA1, populate the display policy field. | |
205 // In M56, we want to display a Neutral security state if the SHA1 | |
206 // certificate was not blocked because the kCertEnableSha1LocalAnchors | |
207 // policy has been set. | |
208 // TODO(elawrence): remove this in M57, https://crbug.com/676826 | |
209 if (state->cert_status & net::CERT_STATUS_SHA1_SIGNATURE_PRESENT) { | |
210 state->display_sha1_from_local_anchors_as_neutral = | |
211 g_browser_process->local_state()->GetBoolean( | |
212 ssl_config::prefs::kCertEnableSha1LocalAnchors); | |
213 } | |
214 | |
215 return state; | 204 return state; |
216 } | 205 } |
OLD | NEW |