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/macros.h" | 10 #include "base/macros.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 managers->get().insert(this); | 137 managers->get().insert(this); |
138 } | 138 } |
139 | 139 |
140 SSLManager::~SSLManager() { | 140 SSLManager::~SSLManager() { |
141 SSLManagerSet* managers = static_cast<SSLManagerSet*>( | 141 SSLManagerSet* managers = static_cast<SSLManagerSet*>( |
142 controller_->GetBrowserContext()->GetUserData(kSSLManagerKeyName)); | 142 controller_->GetBrowserContext()->GetUserData(kSSLManagerKeyName)); |
143 managers->get().erase(this); | 143 managers->get().erase(this); |
144 } | 144 } |
145 | 145 |
146 void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) { | 146 void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) { |
| 147 // TODO(jam): remove details.ssl_status |
147 NavigationEntryImpl* entry = controller_->GetLastCommittedEntry(); | 148 NavigationEntryImpl* entry = controller_->GetLastCommittedEntry(); |
148 | |
149 if (details.is_main_frame) { | |
150 if (entry) { | |
151 // We may not have an entry if this is a navigation to an initial blank | |
152 // page. Add the new data we have. | |
153 entry->GetSSL() = details.ssl_status; | |
154 } | |
155 } | |
156 | |
157 policy()->UpdateEntry(entry, controller_->delegate()->GetWebContents()); | 149 policy()->UpdateEntry(entry, controller_->delegate()->GetWebContents()); |
158 // Always notify the WebContents that the SSL state changed when a | 150 // Always notify the WebContents that the SSL state changed when a |
159 // load is committed, in case the active navigation entry has changed. | 151 // load is committed, in case the active navigation entry has changed. |
160 NotifyDidChangeVisibleSSLState(); | 152 NotifyDidChangeVisibleSSLState(); |
161 } | 153 } |
162 | 154 |
163 void SSLManager::DidRunInsecureContent(const GURL& security_origin) { | 155 void SSLManager::DidRunInsecureContent(const GURL& security_origin) { |
164 NavigationEntryImpl* navigation_entry = controller_->GetLastCommittedEntry(); | 156 NavigationEntryImpl* navigation_entry = controller_->GetLastCommittedEntry(); |
165 policy()->DidRunInsecureContent(navigation_entry, security_origin); | 157 policy()->DidRunInsecureContent(navigation_entry, security_origin); |
166 UpdateEntry(navigation_entry); | 158 UpdateEntry(navigation_entry); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 NotifyDidChangeVisibleSSLState(); | 190 NotifyDidChangeVisibleSSLState(); |
199 } | 191 } |
200 | 192 |
201 void SSLManager::NotifyDidChangeVisibleSSLState() { | 193 void SSLManager::NotifyDidChangeVisibleSSLState() { |
202 WebContentsImpl* contents = | 194 WebContentsImpl* contents = |
203 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); | 195 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); |
204 contents->DidChangeVisibleSSLState(); | 196 contents->DidChangeVisibleSSLState(); |
205 } | 197 } |
206 | 198 |
207 } // namespace content | 199 } // namespace content |
OLD | NEW |