OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/ssl/ssl_manager.h" | 5 #include "content/browser/ssl/ssl_manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 SSLManagerSet* managers = static_cast<SSLManagerSet*>( | 108 SSLManagerSet* managers = static_cast<SSLManagerSet*>( |
109 controller_->GetBrowserContext()->GetUserData(kSSLManagerKeyName)); | 109 controller_->GetBrowserContext()->GetUserData(kSSLManagerKeyName)); |
110 managers->get().erase(this); | 110 managers->get().erase(this); |
111 } | 111 } |
112 | 112 |
113 void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) { | 113 void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) { |
114 NavigationEntryImpl* entry = controller_->GetLastCommittedEntry(); | 114 NavigationEntryImpl* entry = controller_->GetLastCommittedEntry(); |
115 | 115 |
116 if (details.is_main_frame) { | 116 if (details.is_main_frame) { |
117 if (entry) { | 117 if (entry) { |
118 // Decode the security details. | |
119 int ssl_cert_id; | |
120 net::CertStatus ssl_cert_status; | |
121 int ssl_security_bits; | |
122 int ssl_connection_status; | |
123 SignedCertificateTimestampIDStatusList | |
124 ssl_signed_certificate_timestamp_ids; | |
125 DeserializeSecurityInfo(details.serialized_security_info, | |
126 &ssl_cert_id, | |
127 &ssl_cert_status, | |
128 &ssl_security_bits, | |
129 &ssl_connection_status, | |
130 &ssl_signed_certificate_timestamp_ids); | |
131 | |
132 // We may not have an entry if this is a navigation to an initial blank | 118 // We may not have an entry if this is a navigation to an initial blank |
133 // page. Reset the SSL information and add the new data we have. | 119 // page. Add the new data we have. |
134 entry->GetSSL() = SSLStatus(); | 120 entry->GetSSL() = |
135 entry->GetSSL().cert_id = ssl_cert_id; | 121 DeserializeSecurityInfo(details.serialized_security_info); |
136 entry->GetSSL().cert_status = ssl_cert_status; | |
137 entry->GetSSL().security_bits = ssl_security_bits; | |
138 entry->GetSSL().connection_status = ssl_connection_status; | |
139 entry->GetSSL().signed_certificate_timestamp_ids = | |
140 ssl_signed_certificate_timestamp_ids; | |
141 } | 122 } |
142 } | 123 } |
143 | 124 |
144 UpdateEntry(entry); | 125 UpdateEntry(entry); |
145 } | 126 } |
146 | 127 |
147 void SSLManager::DidDisplayInsecureContent() { | 128 void SSLManager::DidDisplayInsecureContent() { |
148 UpdateEntry(controller_->GetLastCommittedEntry()); | 129 UpdateEntry(controller_->GetLastCommittedEntry()); |
149 } | 130 } |
150 | 131 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 187 |
207 WebContentsImpl* contents = | 188 WebContentsImpl* contents = |
208 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); | 189 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); |
209 policy()->UpdateEntry(entry, contents); | 190 policy()->UpdateEntry(entry, contents); |
210 | 191 |
211 if (!entry->GetSSL().Equals(original_ssl_status)) | 192 if (!entry->GetSSL().Equals(original_ssl_status)) |
212 contents->DidChangeVisibleSSLState(); | 193 contents->DidChangeVisibleSSLState(); |
213 } | 194 } |
214 | 195 |
215 } // namespace content | 196 } // namespace content |
OLD | NEW |