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/connection_security_helper.h" | 5 #include "chrome/browser/ssl/connection_security_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if (group == switches::kMarkNonSecureAsNonSecure) | 50 if (group == switches::kMarkNonSecureAsNonSecure) |
51 return ConnectionSecurityHelper::SECURITY_ERROR; | 51 return ConnectionSecurityHelper::SECURITY_ERROR; |
52 | 52 |
53 return ConnectionSecurityHelper::NONE; | 53 return ConnectionSecurityHelper::NONE; |
54 } | 54 } |
55 | 55 |
56 } // namespace | 56 } // namespace |
57 | 57 |
58 ConnectionSecurityHelper::SecurityLevel | 58 ConnectionSecurityHelper::SecurityLevel |
59 ConnectionSecurityHelper::GetSecurityLevelForWebContents( | 59 ConnectionSecurityHelper::GetSecurityLevelForWebContents( |
60 content::WebContents* web_contents) { | 60 const content::WebContents* web_contents) { |
61 if (!web_contents) | 61 if (!web_contents) |
62 return NONE; | 62 return NONE; |
63 | 63 |
64 content::NavigationEntry* entry = | 64 content::NavigationEntry* entry = |
65 web_contents->GetController().GetVisibleEntry(); | 65 web_contents->GetController().GetVisibleEntry(); |
66 if (!entry) | 66 if (!entry) |
67 return NONE; | 67 return NONE; |
68 | 68 |
69 const content::SSLStatus& ssl = entry->GetSSL(); | 69 const content::SSLStatus& ssl = entry->GetSSL(); |
70 switch (ssl.security_style) { | 70 switch (ssl.security_style) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if ((ssl.cert_status & net::CERT_STATUS_IS_EV) && cert) | 121 if ((ssl.cert_status & net::CERT_STATUS_IS_EV) && cert) |
122 return EV_SECURE; | 122 return EV_SECURE; |
123 return SECURE; | 123 return SECURE; |
124 } | 124 } |
125 | 125 |
126 default: | 126 default: |
127 NOTREACHED(); | 127 NOTREACHED(); |
128 return NONE; | 128 return NONE; |
129 } | 129 } |
130 } | 130 } |
OLD | NEW |