OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/toolbar/toolbar_model_impl.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_model_impl.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 "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/public/browser/navigation_entry.h" | 29 #include "content/public/browser/navigation_entry.h" |
30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
31 #include "content/public/browser/web_ui.h" | 31 #include "content/public/browser/web_ui.h" |
32 #include "content/public/common/content_constants.h" | 32 #include "content/public/common/content_constants.h" |
33 #include "content/public/common/ssl_status.h" | 33 #include "content/public/common/ssl_status.h" |
34 #include "grit/components_scaled_resources.h" | 34 #include "grit/components_scaled_resources.h" |
35 #include "grit/theme_resources.h" | 35 #include "grit/theme_resources.h" |
36 #include "net/base/net_util.h" | 36 #include "net/base/net_util.h" |
37 #include "net/cert/cert_status_flags.h" | 37 #include "net/cert/cert_status_flags.h" |
38 #include "net/cert/x509_certificate.h" | 38 #include "net/cert/x509_certificate.h" |
| 39 #include "net/ssl/ssl_connection_status_flags.h" |
39 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
40 | 41 |
41 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
42 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 43 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
43 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" | 44 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
44 #endif | 45 #endif |
45 | 46 |
46 using content::NavigationController; | 47 using content::NavigationController; |
47 using content::NavigationEntry; | 48 using content::NavigationEntry; |
48 using content::SSLStatus; | 49 using content::SSLStatus; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 GetSecurityLevelForFieldTrialGroup( | 137 GetSecurityLevelForFieldTrialGroup( |
137 base::FieldTrialList::FindFullName("SHA1ToolbarUIJanuary2016"), | 138 base::FieldTrialList::FindFullName("SHA1ToolbarUIJanuary2016"), |
138 &security_level)) { | 139 &security_level)) { |
139 return security_level; | 140 return security_level; |
140 } | 141 } |
141 } | 142 } |
142 if (net::IsCertStatusError(ssl.cert_status)) { | 143 if (net::IsCertStatusError(ssl.cert_status)) { |
143 DCHECK(net::IsCertStatusMinorError(ssl.cert_status)); | 144 DCHECK(net::IsCertStatusMinorError(ssl.cert_status)); |
144 return SECURITY_WARNING; | 145 return SECURITY_WARNING; |
145 } | 146 } |
| 147 if (net::SSLConnectionStatusToVersion(ssl.connection_status) == |
| 148 net::SSL_CONNECTION_VERSION_SSL3) { |
| 149 // SSLv3 will be removed in the future. |
| 150 return SECURITY_WARNING; |
| 151 } |
146 if ((ssl.cert_status & net::CERT_STATUS_IS_EV) && cert.get()) | 152 if ((ssl.cert_status & net::CERT_STATUS_IS_EV) && cert.get()) |
147 return EV_SECURE; | 153 return EV_SECURE; |
148 return SECURE; | 154 return SECURE; |
149 } | 155 } |
150 default: | 156 default: |
151 NOTREACHED(); | 157 NOTREACHED(); |
152 return NONE; | 158 return NONE; |
153 } | 159 } |
154 } | 160 } |
155 | 161 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 if (entry && | 391 if (entry && |
386 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL())) | 392 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL())) |
387 return search_terms; | 393 return search_terms; |
388 | 394 |
389 // Otherwise, extract search terms for HTTPS pages that do not have a security | 395 // Otherwise, extract search terms for HTTPS pages that do not have a security |
390 // error. | 396 // error. |
391 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing); | 397 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing); |
392 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ? | 398 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ? |
393 base::string16() : search_terms; | 399 base::string16() : search_terms; |
394 } | 400 } |
OLD | NEW |