Commit c6b1ba29 authored by apatrick@chromium.org's avatar apatrick@chromium.org

Revert 95541 - Profiles: SSLManger broadcasts SSL_INTERNAL_STATE_CHANGED with...

Revert 95541 - Profiles: SSLManger broadcasts SSL_INTERNAL_STATE_CHANGED with a Source<BrowserContext> instead of a Source<NavigationController>.

We do this since SSLManagers want to hear all the notifications coming from different NavigationControllers; not just from the one they are associated with.

BUG=87457
TEST=none
R=abarth
TBR=darin

Review URL: http://codereview.chromium.org/7542029

Sorry about this. The tree stubbornly refuses to go green and yours is the only remaining patch in the blamelist.

TBR=erg@google.com
Review URL: http://codereview.chromium.org/7575035

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95552 0039d316-1c4b-4281-b951-d872f2087c98
parent 66b0a434
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "content/browser/tab_contents/provisional_load_details.h" #include "content/browser/tab_contents/provisional_load_details.h"
#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_service.h" #include "content/common/notification_service.h"
#include "content/common/notification_source.h"
#include "net/base/cert_status_flags.h" #include "net/base/cert_status_flags.h"
// static // static
...@@ -45,11 +44,10 @@ void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh, ...@@ -45,11 +44,10 @@ void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh,
} }
// static // static
void SSLManager::NotifySSLInternalStateChanged( void SSLManager::NotifySSLInternalStateChanged() {
NavigationController* controller) {
NotificationService::current()->Notify( NotificationService::current()->Notify(
content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED,
Source<content::BrowserContext>(controller->browser_context()), NotificationService::AllSources(),
NotificationService::NoDetails()); NotificationService::NoDetails());
} }
...@@ -107,8 +105,7 @@ SSLManager::SSLManager(NavigationController* controller) ...@@ -107,8 +105,7 @@ SSLManager::SSLManager(NavigationController* controller)
registrar_.Add(this, content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, registrar_.Add(this, content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE,
Source<NavigationController>(controller_)); Source<NavigationController>(controller_));
registrar_.Add(this, content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, registrar_.Add(this, content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED,
Source<content::BrowserContext>( NotificationService::AllSources());
controller_->browser_context()));
} }
SSLManager::~SSLManager() { SSLManager::~SSLManager() {
......
...@@ -52,7 +52,7 @@ class SSLManager : public NotificationObserver { ...@@ -52,7 +52,7 @@ class SSLManager : public NotificationObserver {
// Called when SSL state for a host or tab changes. Broadcasts the // Called when SSL state for a host or tab changes. Broadcasts the
// SSL_INTERNAL_STATE_CHANGED notification. // SSL_INTERNAL_STATE_CHANGED notification.
static void NotifySSLInternalStateChanged(NavigationController* controller); static void NotifySSLInternalStateChanged();
// Convenience methods for serializing/deserializing the security info. // Convenience methods for serializing/deserializing the security info.
static std::string SerializeSecurityInfo(int cert_id, static std::string SerializeSecurityInfo(int cert_id,
......
...@@ -9,14 +9,13 @@ ...@@ -9,14 +9,13 @@
#include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/navigation_controller.h"
SSLPolicyBackend::SSLPolicyBackend(NavigationController* controller) SSLPolicyBackend::SSLPolicyBackend(NavigationController* controller)
: ssl_host_state_(controller->browser_context()->GetSSLHostState()), : ssl_host_state_(controller->browser_context()->GetSSLHostState()) {
controller_(controller) { DCHECK(controller);
DCHECK(controller_);
} }
void SSLPolicyBackend::HostRanInsecureContent(const std::string& host, int id) { void SSLPolicyBackend::HostRanInsecureContent(const std::string& host, int id) {
ssl_host_state_->HostRanInsecureContent(host, id); ssl_host_state_->HostRanInsecureContent(host, id);
SSLManager::NotifySSLInternalStateChanged(controller_); SSLManager::NotifySSLInternalStateChanged();
} }
bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host, bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host,
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -40,8 +40,6 @@ class SSLPolicyBackend { ...@@ -40,8 +40,6 @@ class SSLPolicyBackend {
// SSL state specific for each host. // SSL state specific for each host.
SSLHostState* ssl_host_state_; SSLHostState* ssl_host_state_;
NavigationController* controller_;
DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend);
}; };
......
...@@ -1002,7 +1002,7 @@ void TabContents::OnDidLoadResourceFromMemoryCache( ...@@ -1002,7 +1002,7 @@ void TabContents::OnDidLoadResourceFromMemoryCache(
void TabContents::OnDidDisplayInsecureContent() { void TabContents::OnDidDisplayInsecureContent() {
UserMetrics::RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); UserMetrics::RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent"));
displayed_insecure_content_ = true; displayed_insecure_content_ = true;
SSLManager::NotifySSLInternalStateChanged(&controller()); SSLManager::NotifySSLInternalStateChanged();
} }
void TabContents::OnDidRunInsecureContent( void TabContents::OnDidRunInsecureContent(
...@@ -1016,7 +1016,7 @@ void TabContents::OnDidRunInsecureContent( ...@@ -1016,7 +1016,7 @@ void TabContents::OnDidRunInsecureContent(
} }
controller_.ssl_manager()->DidRunInsecureContent(security_origin); controller_.ssl_manager()->DidRunInsecureContent(security_origin);
displayed_insecure_content_ = true; displayed_insecure_content_ = true;
SSLManager::NotifySSLInternalStateChanged(&controller()); SSLManager::NotifySSLInternalStateChanged();
} }
void TabContents::OnDocumentLoadedInFrame(int64 frame_id) { void TabContents::OnDocumentLoadedInFrame(int64 frame_id) {
......
...@@ -162,8 +162,8 @@ enum { ...@@ -162,8 +162,8 @@ enum {
// or a secure origin might have included some insecure content. Listen to // or a secure origin might have included some insecure content. Listen to
// this notifiation if you need to keep track of our internal SSL state. // this notifiation if you need to keep track of our internal SSL state.
// //
// The source will be the browser context. The details will be the navigation // The source will be the navigation controller associated with the state
// controller associated with the state change. // change. There are no details.
NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, NOTIFICATION_SSL_INTERNAL_STATE_CHANGED,
// The user accepted or dismissed a SSL client authentication request. // The user accepted or dismissed a SSL client authentication request.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment