OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file describes a central switchboard for notifications that might | 5 // This file describes a central switchboard for notifications that might |
6 // happen in various parts of the application, and allows users to register | 6 // happen in various parts of the application, and allows users to register |
7 // observers for various classes of events that they're interested in. | 7 // observers for various classes of events that they're interested in. |
8 | 8 |
9 #ifndef CONTENT_COMMON_NOTIFICATION_SERVICE_H_ | 9 #ifndef CONTENT_COMMON_NOTIFICATION_SERVICE_H_ |
10 #define CONTENT_COMMON_NOTIFICATION_SERVICE_H_ | 10 #define CONTENT_COMMON_NOTIFICATION_SERVICE_H_ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 | 14 |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "content/common/content_notification_types.h" | 16 #include "content/common/content_notification_types.h" |
17 #include "content/common/content_export.h" | |
darin (slow to review)
2011/09/04 15:41:04
nit: "export" before "notification"
Dirk Pranke
2011/09/07 01:46:07
Done.
| |
17 #include "content/common/notification_details.h" | 18 #include "content/common/notification_details.h" |
18 #include "content/common/notification_source.h" | 19 #include "content/common/notification_source.h" |
19 | 20 |
20 class NotificationObserver; | 21 class NotificationObserver; |
21 | 22 |
22 class NotificationService { | 23 class CONTENT_EXPORT NotificationService { |
23 public: | 24 public: |
24 // Returns the NotificationService object for the current thread, or NULL if | 25 // Returns the NotificationService object for the current thread, or NULL if |
25 // none. | 26 // none. |
26 static NotificationService* current(); | 27 static NotificationService* current(); |
27 | 28 |
28 // Normally instantiated when the thread is created. Not all threads have | 29 // Normally instantiated when the thread is created. Not all threads have |
29 // a NotificationService. Only one instance should be created per thread. | 30 // a NotificationService. Only one instance should be created per thread. |
30 NotificationService(); | 31 NotificationService(); |
31 ~NotificationService(); | 32 ~NotificationService(); |
32 | 33 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 #ifndef NDEBUG | 117 #ifndef NDEBUG |
117 // Used to check to see that AddObserver and RemoveObserver calls are | 118 // Used to check to see that AddObserver and RemoveObserver calls are |
118 // balanced. | 119 // balanced. |
119 NotificationObserverCount observer_counts_; | 120 NotificationObserverCount observer_counts_; |
120 #endif | 121 #endif |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(NotificationService); | 123 DISALLOW_COPY_AND_ASSIGN(NotificationService); |
123 }; | 124 }; |
124 | 125 |
125 #endif // CONTENT_COMMON_NOTIFICATION_SERVICE_H_ | 126 #endif // CONTENT_COMMON_NOTIFICATION_SERVICE_H_ |
OLD | NEW |