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 defines the type used to provide sources for NotificationService | 5 // This file defines the type used to provide sources for NotificationService |
6 // notifications. | 6 // notifications. |
7 | 7 |
8 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_SOURCE_H_ | 8 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_SOURCE_H_ |
9 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_SOURCE_H_ | 9 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_SOURCE_H_ |
10 #pragma once | |
11 | 10 |
12 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
13 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
14 | 13 |
15 namespace content { | 14 namespace content { |
16 | 15 |
17 // Do not declare a NotificationSource directly--use either | 16 // Do not declare a NotificationSource directly--use either |
18 // "Source<sourceclassname>(sourceclasspointer)" or | 17 // "Source<sourceclassname>(sourceclasspointer)" or |
19 // NotificationService::AllSources(). | 18 // NotificationService::AllSources(). |
20 class CONTENT_EXPORT NotificationSource { | 19 class CONTENT_EXPORT NotificationSource { |
(...skipping 30 matching lines...) Expand all Loading... |
51 : NotificationSource(other) {} | 50 : NotificationSource(other) {} |
52 | 51 |
53 T* operator->() const { return ptr(); } | 52 T* operator->() const { return ptr(); } |
54 // The casts here allow this to compile with both T = Foo and T = const Foo. | 53 // The casts here allow this to compile with both T = Foo and T = const Foo. |
55 T* ptr() const { return static_cast<T*>(const_cast<void*>(ptr_)); } | 54 T* ptr() const { return static_cast<T*>(const_cast<void*>(ptr_)); } |
56 }; | 55 }; |
57 | 56 |
58 } // namespace content | 57 } // namespace content |
59 | 58 |
60 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_SOURCE_H_ | 59 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_SOURCE_H_ |
OLD | NEW |