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 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class NotificationObserver; | 16 class NotificationObserver; |
17 class NotificationRegistrar; | 17 class NotificationRegistrar; |
18 } | 18 } |
19 | 19 |
20 class NotificationServiceImpl : public content::NotificationService { | 20 class CONTENT_EXPORT NotificationServiceImpl |
| 21 : public content::NotificationService { |
21 public: | 22 public: |
22 static NotificationServiceImpl* current(); | 23 static NotificationServiceImpl* current(); |
23 | 24 |
24 // Normally instantiated when the thread is created. Not all threads have | 25 // Normally instantiated when the thread is created. Not all threads have |
25 // a NotificationService. Only one instance should be created per thread. | 26 // a NotificationService. Only one instance should be created per thread. |
26 NotificationServiceImpl(); | 27 NotificationServiceImpl(); |
27 virtual ~NotificationServiceImpl(); | 28 virtual ~NotificationServiceImpl(); |
28 | 29 |
29 // content::NotificationService | 30 // content::NotificationService |
30 virtual void Notify(int type, | 31 virtual void Notify(int type, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #ifndef NDEBUG | 84 #ifndef NDEBUG |
84 // Used to check to see that AddObserver and RemoveObserver calls are | 85 // Used to check to see that AddObserver and RemoveObserver calls are |
85 // balanced. | 86 // balanced. |
86 NotificationObserverCount observer_counts_; | 87 NotificationObserverCount observer_counts_; |
87 #endif | 88 #endif |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(NotificationServiceImpl); | 90 DISALLOW_COPY_AND_ASSIGN(NotificationServiceImpl); |
90 }; | 91 }; |
91 | 92 |
92 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 93 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
OLD | NEW |