OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_ |
| 6 #define CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_ |
| 7 |
| 8 #include "chrome/browser/sync/util/pthread_helpers_fwd.h" |
| 9 |
| 10 // An abstract base class for listening to events. |
| 11 // |
| 12 // Don't inherit from this class yourself. Using NewEventListenerHookup() is |
| 13 // much easier. |
| 14 template <typename EventType> |
| 15 class EventListener { |
| 16 public: |
| 17 virtual void HandleEvent(const EventType& event) = 0; |
| 18 }; |
| 19 |
| 20 // See the -inl.h for details about the following. |
| 21 |
| 22 template <typename EventTraits, typename NotifyLock = PThreadNoLock, |
| 23 typename ScopedNotifyLocker = PThreadScopedLock<NotifyLock> > |
| 24 class EventChannel; |
| 25 |
| 26 class EventListenerHookup; |
| 27 |
| 28 template <typename EventChannel, typename CallbackObject, |
| 29 typename CallbackMethod> |
| 30 EventListenerHookup* NewEventListenerHookup(EventChannel* channel, |
| 31 CallbackObject* cbobject, |
| 32 CallbackMethod cbmethod); |
| 33 |
| 34 template <typename EventChannel, typename CallbackObject, |
| 35 typename CallbackMethod, typename CallbackArg0> |
| 36 EventListenerHookup* NewEventListenerHookup(EventChannel* channel, |
| 37 CallbackObject* cbobject, |
| 38 CallbackMethod cbmethod, |
| 39 CallbackArg0 arg0); |
| 40 |
| 41 #endif // CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_ |
OLD | NEW |