OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ssl_manager.h" | 5 #include "chrome/browser/ssl/ssl_manager.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
10 #include "chrome/browser/load_from_memory_cache_details.h" | 10 #include "chrome/browser/load_from_memory_cache_details.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 Pickle pickle(state.data(), static_cast<int>(state.size())); | 89 Pickle pickle(state.data(), static_cast<int>(state.size())); |
90 void * iter = NULL; | 90 void * iter = NULL; |
91 return pickle.ReadInt(&iter, cert_id) && | 91 return pickle.ReadInt(&iter, cert_id) && |
92 pickle.ReadInt(&iter, cert_status) && | 92 pickle.ReadInt(&iter, cert_status) && |
93 pickle.ReadInt(&iter, security_bits) && | 93 pickle.ReadInt(&iter, security_bits) && |
94 pickle.ReadInt(&iter, ssl_connection_status); | 94 pickle.ReadInt(&iter, ssl_connection_status); |
95 } | 95 } |
96 | 96 |
97 // static | 97 // static |
98 std::wstring SSLManager::GetEVCertName(const net::X509Certificate& cert) { | 98 string16 SSLManager::GetEVCertName(const net::X509Certificate& cert) { |
99 // EV are required to have an organization name and country. | 99 // EV are required to have an organization name and country. |
100 if (cert.subject().organization_names.empty() || | 100 if (cert.subject().organization_names.empty() || |
101 cert.subject().country_name.empty()) { | 101 cert.subject().country_name.empty()) { |
102 NOTREACHED(); | 102 NOTREACHED(); |
103 return std::wstring(); | 103 return string16(); |
104 } | 104 } |
105 | 105 |
106 return l10n_util::GetStringF(IDS_SECURE_CONNECTION_EV, | 106 return l10n_util::GetStringFUTF16( |
107 UTF8ToWide(cert.subject().organization_names[0]), | 107 IDS_SECURE_CONNECTION_EV, |
108 UTF8ToWide(cert.subject().country_name)); | 108 UTF8ToUTF16(cert.subject().organization_names[0]), |
| 109 UTF8ToUTF16(cert.subject().country_name)); |
109 } | 110 } |
110 | 111 |
111 SSLManager::SSLManager(NavigationController* controller) | 112 SSLManager::SSLManager(NavigationController* controller) |
112 : backend_(controller), | 113 : backend_(controller), |
113 policy_(new SSLPolicy(&backend_)), | 114 policy_(new SSLPolicy(&backend_)), |
114 controller_(controller) { | 115 controller_(controller) { |
115 DCHECK(controller_); | 116 DCHECK(controller_); |
116 | 117 |
117 // Subscribe to various notifications. | 118 // Subscribe to various notifications. |
118 registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, | 119 registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 265 |
265 policy()->UpdateEntry(entry, controller_->tab_contents()); | 266 policy()->UpdateEntry(entry, controller_->tab_contents()); |
266 | 267 |
267 if (!entry->ssl().Equals(original_ssl_status)) { | 268 if (!entry->ssl().Equals(original_ssl_status)) { |
268 NotificationService::current()->Notify( | 269 NotificationService::current()->Notify( |
269 NotificationType::SSL_VISIBLE_STATE_CHANGED, | 270 NotificationType::SSL_VISIBLE_STATE_CHANGED, |
270 Source<NavigationController>(controller_), | 271 Source<NavigationController>(controller_), |
271 NotificationService::NoDetails()); | 272 NotificationService::NoDetails()); |
272 } | 273 } |
273 } | 274 } |
OLD | NEW |