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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // static | 72 // static |
73 bool SSLManager::DeserializeSecurityInfo(const std::string& state, | 73 bool SSLManager::DeserializeSecurityInfo(const std::string& state, |
74 int* cert_id, | 74 int* cert_id, |
75 int* cert_status, | 75 int* cert_status, |
76 int* security_bits, | 76 int* security_bits, |
77 int* ssl_connection_status) { | 77 int* ssl_connection_status) { |
78 DCHECK(cert_id && cert_status && security_bits && ssl_connection_status); | 78 DCHECK(cert_id && cert_status && security_bits && ssl_connection_status); |
79 if (state.empty()) { | 79 if (state.empty()) { |
80 // No SSL used. | 80 // No SSL used. |
81 *cert_id = 0; | 81 *cert_id = 0; |
| 82 // The following are not applicable and are set to the default values. |
82 *cert_status = 0; | 83 *cert_status = 0; |
83 *security_bits = 0; // Not encrypted. | 84 *security_bits = -1; |
84 *ssl_connection_status = 0; | 85 *ssl_connection_status = 0; |
85 return false; | 86 return false; |
86 } | 87 } |
87 | 88 |
88 Pickle pickle(state.data(), static_cast<int>(state.size())); | 89 Pickle pickle(state.data(), static_cast<int>(state.size())); |
89 void * iter = NULL; | 90 void * iter = NULL; |
90 return pickle.ReadInt(&iter, cert_id) && | 91 return pickle.ReadInt(&iter, cert_id) && |
91 pickle.ReadInt(&iter, cert_status) && | 92 pickle.ReadInt(&iter, cert_status) && |
92 pickle.ReadInt(&iter, security_bits) && | 93 pickle.ReadInt(&iter, security_bits) && |
93 pickle.ReadInt(&iter, ssl_connection_status); | 94 pickle.ReadInt(&iter, ssl_connection_status); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 264 |
264 policy()->UpdateEntry(entry, controller_->tab_contents()); | 265 policy()->UpdateEntry(entry, controller_->tab_contents()); |
265 | 266 |
266 if (!entry->ssl().Equals(original_ssl_status)) { | 267 if (!entry->ssl().Equals(original_ssl_status)) { |
267 NotificationService::current()->Notify( | 268 NotificationService::current()->Notify( |
268 NotificationType::SSL_VISIBLE_STATE_CHANGED, | 269 NotificationType::SSL_VISIBLE_STATE_CHANGED, |
269 Source<NavigationController>(controller_), | 270 Source<NavigationController>(controller_), |
270 NotificationService::NoDetails()); | 271 NotificationService::NoDetails()); |
271 } | 272 } |
272 } | 273 } |
OLD | NEW |