summaryrefslogtreecommitdiffstats
path: root/chrome/common/notification_service.h
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/common/notification_service.h
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/common/notification_service.h')
-rw-r--r--chrome/common/notification_service.h27
1 files changed, 8 insertions, 19 deletions
diff --git a/chrome/common/notification_service.h b/chrome/common/notification_service.h
index 170baa6..8fb8981 100644
--- a/chrome/common/notification_service.h
+++ b/chrome/common/notification_service.h
@@ -6,16 +6,16 @@
// happen in various parts of the application, and allows users to register
// observers for various classes of events that they're interested in.
-#ifndef CHROME_COMMON_NOTIFICATION_SERVICE_H__
-#define CHROME_COMMON_NOTIFICATION_SERVICE_H__
+#ifndef CHROME_COMMON_NOTIFICATION_SERVICE_H_
+#define CHROME_COMMON_NOTIFICATION_SERVICE_H_
#include <map>
#include "base/observer_list.h"
-#include "base/values.h"
#include "chrome/common/notification_details.h"
+#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_source.h"
-#include "chrome/common/notification_types.h"
+#include "chrome/common/notification_type.h"
class NotificationObserver;
@@ -86,27 +86,16 @@ class NotificationService {
// Keeps track of the observers for each type of notification.
// Until we get a prohibitively large number of notification types,
// a simple array is probably the fastest way to dispatch.
- NotificationSourceMap observers_[NOTIFICATION_TYPE_COUNT];
+ NotificationSourceMap observers_[NotificationType::NOTIFICATION_TYPE_COUNT];
#ifndef NDEBUG
// Used to check to see that AddObserver and RemoveObserver calls are
// balanced.
- int observer_counts_[NOTIFICATION_TYPE_COUNT];
+ int observer_counts_[NotificationType::NOTIFICATION_TYPE_COUNT];
#endif
- DISALLOW_EVIL_CONSTRUCTORS(NotificationService);
+ DISALLOW_COPY_AND_ASSIGN(NotificationService);
};
-// This is the base class for notification observers. When a matching
-// notification is posted to the notification service, Observe is called.
-class NotificationObserver {
- public:
- virtual ~NotificationObserver();
-
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) = 0;
-};
-
-#endif // CHROME_COMMON_NOTIFICATION_SERVICE_H__
+#endif // CHROME_COMMON_NOTIFICATION_SERVICE_H_