| Index: content/browser/ssl/ssl_manager.cc
|
| diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
|
| index d41260e583e325a7dc9ef4e251c148ba006ce283..8435f13cf41574a0561bb852f3456ba5d1c425b3 100644
|
| --- a/content/browser/ssl/ssl_manager.cc
|
| +++ b/content/browser/ssl/ssl_manager.cc
|
| @@ -60,15 +60,6 @@ void SSLManager::OnSSLCertificateError(
|
| fatal)));
|
| }
|
|
|
| -// static
|
| -void SSLManager::NotifySSLInternalStateChanged(
|
| - NavigationControllerImpl* controller) {
|
| - NotificationService::current()->Notify(
|
| - NOTIFICATION_SSL_INTERNAL_STATE_CHANGED,
|
| - Source<BrowserContext>(controller->GetBrowserContext()),
|
| - NotificationService::NoDetails());
|
| -}
|
| -
|
| SSLManager::SSLManager(NavigationControllerImpl* controller)
|
| : backend_(controller),
|
| policy_(new SSLPolicy(&backend_)),
|
| @@ -85,10 +76,6 @@ SSLManager::SSLManager(NavigationControllerImpl* controller)
|
| registrar_.Add(
|
| this, NOTIFICATION_LOAD_FROM_MEMORY_CACHE,
|
| Source<NavigationController>(controller_));
|
| - registrar_.Add(
|
| - this, NOTIFICATION_SSL_INTERNAL_STATE_CHANGED,
|
| - Source<BrowserContext>(
|
| - controller_->GetBrowserContext()));
|
| }
|
|
|
| SSLManager::~SSLManager() {
|
| @@ -128,10 +115,30 @@ void SSLManager::DidCommitProvisionalLoad(
|
| UpdateEntry(entry);
|
| }
|
|
|
| +void SSLManager::DidDisplayInsecureContent() {
|
| + UpdateEntry(
|
| + NavigationEntryImpl::FromNavigationEntry(controller_->GetActiveEntry()));
|
| +}
|
| +
|
| void SSLManager::DidRunInsecureContent(const std::string& security_origin) {
|
| - policy()->DidRunInsecureContent(
|
| - NavigationEntryImpl::FromNavigationEntry(controller_->GetActiveEntry()),
|
| - security_origin);
|
| + NavigationEntryImpl* navigation_entry =
|
| + NavigationEntryImpl::FromNavigationEntry(controller_->GetActiveEntry());
|
| + policy()->DidRunInsecureContent(navigation_entry, security_origin);
|
| + UpdateEntry(navigation_entry);
|
| +}
|
| +
|
| +void SSLManager::UpdateEntry(NavigationEntryImpl* entry) {
|
| + // We don't always have a navigation entry to update, for example in the
|
| + // case of the Web Inspector.
|
| + if (!entry)
|
| + return;
|
| +
|
| + SSLStatus original_ssl_status = entry->GetSSL(); // Copy!
|
| +
|
| + policy()->UpdateEntry(entry, controller_->web_contents());
|
| +
|
| + if (!entry->GetSSL().Equals(original_ssl_status))
|
| + controller_->web_contents()->NotifyVisibleSSLStateChanged();
|
| }
|
|
|
| void SSLManager::Observe(int type,
|
| @@ -151,9 +158,6 @@ void SSLManager::Observe(int type,
|
| DidLoadFromMemoryCache(
|
| Details<LoadFromMemoryCacheDetails>(details).ptr());
|
| break;
|
| - case NOTIFICATION_SSL_INTERNAL_STATE_CHANGED:
|
| - DidChangeSSLInternalState();
|
| - break;
|
| default:
|
| NOTREACHED() << "The SSLManager received an unexpected notification.";
|
| }
|
| @@ -198,27 +202,4 @@ void SSLManager::DidReceiveResourceRedirect(ResourceRedirectDetails* details) {
|
| // HTTP request to https://attacker.com/payload.js.
|
| }
|
|
|
| -void SSLManager::DidChangeSSLInternalState() {
|
| - UpdateEntry(
|
| - NavigationEntryImpl::FromNavigationEntry(controller_->GetActiveEntry()));
|
| -}
|
| -
|
| -void SSLManager::UpdateEntry(NavigationEntryImpl* entry) {
|
| - // We don't always have a navigation entry to update, for example in the
|
| - // case of the Web Inspector.
|
| - if (!entry)
|
| - return;
|
| -
|
| - SSLStatus original_ssl_status = entry->GetSSL(); // Copy!
|
| -
|
| - policy()->UpdateEntry(entry, controller_->web_contents());
|
| -
|
| - if (!entry->GetSSL().Equals(original_ssl_status)) {
|
| - NotificationService::current()->Notify(
|
| - NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
|
| - Source<NavigationController>(controller_),
|
| - NotificationService::NoDetails());
|
| - }
|
| -}
|
| -
|
| } // namespace content
|
|
|