summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-01 18:16:56 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-01 18:16:56 +0000
commitbfd04a62ce610d7bb61dbb78811dccbed23589b7 (patch)
tree70bb228c0f00ba1c12c584efd569daccf96b4026 /chrome/browser/ssl
parenta814d863440f0a154a7299f2d8b440f405c7700e (diff)
downloadchromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.zip
chromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.tar.gz
chromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.tar.bz2
Remove most header file dependencies on the notification type list. It is
really painful to add more types, since lots of headers include the notification service to derive from the notification observer. This splits that out, so much less of the project should end up including notification_types.h ---Paths modified but not in any changelist: Review URL: http://codereview.chromium.org/19744 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl')
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc4
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.h2
-rw-r--r--chrome/browser/ssl/ssl_manager.cc28
-rw-r--r--chrome/browser/ssl/ssl_manager.h2
-rw-r--r--chrome/browser/ssl/ssl_policy.cc6
5 files changed, 23 insertions, 19 deletions
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index 96d0003..313908e 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ssl/ssl_blocking_page.h"
#include "base/string_piece.h"
+#include "base/values.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_resources.h"
#include "chrome/browser/cert_store.h"
@@ -15,6 +16,7 @@
#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/l10n_util.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
@@ -80,7 +82,7 @@ void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) {
entry->ssl().set_cert_status(ssl_info.cert_status);
entry->ssl().set_security_bits(ssl_info.security_bits);
NotificationService::current()->Notify(
- NOTIFY_SSL_STATE_CHANGED,
+ NotificationType::SSL_STATE_CHANGED,
Source<NavigationController>(web->controller()),
NotificationService::NoDetails());
}
diff --git a/chrome/browser/ssl/ssl_blocking_page.h b/chrome/browser/ssl/ssl_blocking_page.h
index c3c2289..5ea0658 100644
--- a/chrome/browser/ssl/ssl_blocking_page.h
+++ b/chrome/browser/ssl/ssl_blocking_page.h
@@ -11,6 +11,8 @@
#include "chrome/browser/ssl/ssl_manager.h"
#include "chrome/views/decision.h"
+class DictionaryValue;
+
// This class is responsible for showing/hiding the interstitial page that is
// shown when a certificate error happens.
// It deletes itself when the interstitial page is closed.
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc
index 49227e2..99440b9 100644
--- a/chrome/browser/ssl/ssl_manager.cc
+++ b/chrome/browser/ssl/ssl_manager.cc
@@ -102,15 +102,15 @@ SSLManager::SSLManager(NavigationController* controller, Delegate* delegate)
delegate_ = SSLPolicy::GetDefaultPolicy();
// Subscribe to various notifications.
- registrar_.Add(this, NOTIFY_NAV_ENTRY_COMMITTED,
+ registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
Source<NavigationController>(controller_));
- registrar_.Add(this, NOTIFY_FAIL_PROVISIONAL_LOAD_WITH_ERROR,
+ registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR,
Source<NavigationController>(controller_));
- registrar_.Add(this, NOTIFY_RESOURCE_RESPONSE_STARTED,
+ registrar_.Add(this, NotificationType::RESOURCE_RESPONSE_STARTED,
Source<NavigationController>(controller_));
- registrar_.Add(this, NOTIFY_RESOURCE_RECEIVED_REDIRECT,
+ registrar_.Add(this, NotificationType::RESOURCE_RECEIVED_REDIRECT,
Source<NavigationController>(controller_));
- registrar_.Add(this, NOTIFY_LOAD_FROM_MEMORY_CACHE,
+ registrar_.Add(this, NotificationType::LOAD_FROM_MEMORY_CACHE,
Source<NavigationController>(controller_));
}
@@ -496,27 +496,27 @@ void SSLManager::Observe(NotificationType type,
DCHECK(source == Source<NavigationController>(controller_));
// Dispatch by type.
- switch (type) {
- case NOTIFY_NAV_ENTRY_COMMITTED:
+ switch (type.value) {
+ case NotificationType::NAV_ENTRY_COMMITTED:
DidCommitProvisionalLoad(details);
break;
- case NOTIFY_FAIL_PROVISIONAL_LOAD_WITH_ERROR:
+ case NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR:
DidFailProvisionalLoadWithError(
Details<ProvisionalLoadDetails>(details).ptr());
break;
- case NOTIFY_RESOURCE_RESPONSE_STARTED:
+ case NotificationType::RESOURCE_RESPONSE_STARTED:
DidStartResourceResponse(Details<ResourceRequestDetails>(details).ptr());
break;
- case NOTIFY_RESOURCE_RECEIVED_REDIRECT:
+ case NotificationType::RESOURCE_RECEIVED_REDIRECT:
DidReceiveResourceRedirect(
Details<ResourceRedirectDetails>(details).ptr());
break;
- case NOTIFY_LOAD_FROM_MEMORY_CACHE:
+ case NotificationType::LOAD_FROM_MEMORY_CACHE:
DidLoadFromMemoryCache(
Details<LoadFromMemoryCacheDetails>(details).ptr());
break;
- default:
- NOTREACHED() << "The SSLManager received an unexpected notification.";
+ default:
+ NOTREACHED() << "The SSLManager received an unexpected notification.";
}
}
@@ -613,7 +613,7 @@ void SSLManager::DidCommitProvisionalLoad(
if (changed) {
// Only send the notification when something actually changed.
NotificationService::current()->Notify(
- NOTIFY_SSL_STATE_CHANGED,
+ NotificationType::SSL_STATE_CHANGED,
Source<NavigationController>(controller_),
NotificationService::NoDetails());
}
diff --git a/chrome/browser/ssl/ssl_manager.h b/chrome/browser/ssl/ssl_manager.h
index a58f3fe..3294e42 100644
--- a/chrome/browser/ssl/ssl_manager.h
+++ b/chrome/browser/ssl/ssl_manager.h
@@ -14,8 +14,8 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/tab_contents/provisional_load_details.h"
#include "chrome/browser/tab_contents/security_style.h"
+#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
-#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc
index 61aada3..1784deb 100644
--- a/chrome/browser/ssl/ssl_policy.cc
+++ b/chrome/browser/ssl/ssl_policy.cc
@@ -258,7 +258,7 @@ class DefaultPolicy : public SSLPolicy {
if (error->manager()->SetMaxSecurityStyle(
SECURITY_STYLE_AUTHENTICATION_BROKEN)) {
NotificationService::current()->Notify(
- NOTIFY_SSL_STATE_CHANGED,
+ NotificationType::SSL_STATE_CHANGED,
Source<NavigationController>(error->manager()->controller()),
Details<NavigationEntry>(
error->manager()->controller()->GetActiveEntry()));
@@ -313,7 +313,7 @@ class DefaultPolicy : public SSLPolicy {
AddMessageToConsole(msg, MESSAGE_LEVEL_WARNING);
NotificationService::current()->Notify(
- NOTIFY_SSL_STATE_CHANGED,
+ NotificationType::SSL_STATE_CHANGED,
Source<NavigationController>(navigation_controller),
Details<NavigationEntry>(entry));
}
@@ -410,7 +410,7 @@ void SSLPolicy::OnRequestStarted(SSLManager* manager, const GURL& url,
if (changed) {
// Only send the notification when something actually changed.
NotificationService::current()->Notify(
- NOTIFY_SSL_STATE_CHANGED,
+ NotificationType::SSL_STATE_CHANGED,
Source<NavigationController>(manager->controller()),
NotificationService::NoDetails());
}