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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 NavigationEntryImpl* entry = controller_->GetLastCommittedEntry(); | 147 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()); | 148 policy()->UpdateEntry(entry, controller_->delegate()->GetWebContents()); |
158 // Always notify the WebContents that the SSL state changed when a | 149 // Always notify the WebContents that the SSL state changed when a |
159 // load is committed, in case the active navigation entry has changed. | 150 // load is committed, in case the active navigation entry has changed. |
160 NotifyDidChangeVisibleSSLState(); | 151 NotifyDidChangeVisibleSSLState(); |
161 } | 152 } |
162 | 153 |
163 void SSLManager::DidRunInsecureContent(const GURL& security_origin) { | 154 void SSLManager::DidRunInsecureContent(const GURL& security_origin) { |
164 NavigationEntryImpl* navigation_entry = controller_->GetLastCommittedEntry(); | 155 NavigationEntryImpl* navigation_entry = controller_->GetLastCommittedEntry(); |
165 policy()->DidRunInsecureContent(navigation_entry, security_origin); | 156 policy()->DidRunInsecureContent(navigation_entry, security_origin); |
166 UpdateEntry(navigation_entry); | 157 UpdateEntry(navigation_entry); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 NotifyDidChangeVisibleSSLState(); | 195 NotifyDidChangeVisibleSSLState(); |
205 } | 196 } |
206 | 197 |
207 void SSLManager::NotifyDidChangeVisibleSSLState() { | 198 void SSLManager::NotifyDidChangeVisibleSSLState() { |
208 WebContentsImpl* contents = | 199 WebContentsImpl* contents = |
209 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); | 200 static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents()); |
210 contents->DidChangeVisibleSSLState(); | 201 contents->DidChangeVisibleSSLState(); |
211 } | 202 } |
212 | 203 |
213 } // namespace content | 204 } // namespace content |
OLD | NEW |