Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(933)

Unified Diff: content/browser/ssl/ssl_manager.cc

Issue 1244863003: Attach a SecurityStyle to each request in ResourceLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test fixes Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/ssl/ssl_manager.cc
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index ab1048c31404dc35e1eb261f1aab427c8d76f10e..e4c71e3dc4e0f8b2c520afe4cb9d9979d51140d9 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -121,7 +121,10 @@ void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) {
}
}
- UpdateEntry(entry);
+ policy()->UpdateEntry(entry, controller_->delegate()->GetWebContents());
+ // Always notify the WebContents that the SSL state changed when a
+ // load is committed, in case the active navigation entry has changed.
+ NotifyDidChangeVisibleSSLState();
}
void SSLManager::DidDisplayInsecureContent() {
@@ -184,12 +187,16 @@ void SSLManager::UpdateEntry(NavigationEntryImpl* entry) {
SSLStatus original_ssl_status = entry->GetSSL(); // Copy!
- WebContentsImpl* contents =
- static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents());
- policy()->UpdateEntry(entry, contents);
+ policy()->UpdateEntry(entry, controller_->delegate()->GetWebContents());
if (!entry->GetSSL().Equals(original_ssl_status))
- contents->DidChangeVisibleSSLState();
+ NotifyDidChangeVisibleSSLState();
+}
+
+void SSLManager::NotifyDidChangeVisibleSSLState() {
+ WebContentsImpl* contents =
+ static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents());
+ contents->DidChangeVisibleSSLState();
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698