Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Side by Side Diff: chrome/common/deprecated/event_sys.h

Issue 3032024: Add undeclared virtual destructors part 2... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « app/menus/button_menu_item_model.h ('k') | chrome/common/mach_message_source_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 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 CHROME_COMMON_DEPRECATED_EVENT_SYS_H_ 5 #ifndef CHROME_COMMON_DEPRECATED_EVENT_SYS_H_
6 #define CHROME_COMMON_DEPRECATED_EVENT_SYS_H_ 6 #define CHROME_COMMON_DEPRECATED_EVENT_SYS_H_
7 7
8 // TODO: This class should be removed or moved to Notifier code. 8 // TODO: This class should be removed or moved to Notifier code.
9 // See Bug 42450 (http://code.google.com/p/chromium/issues/detail?id=42450). 9 // See Bug 42450 (http://code.google.com/p/chromium/issues/detail?id=42450).
10 10
11 class AutoLock; 11 class AutoLock;
12 class Lock; 12 class Lock;
13 13
14 // An abstract base class for listening to events. 14 // An abstract base class for listening to events.
15 // 15 //
16 // Don't inherit from this class yourself. Using NewEventListenerHookup() is 16 // Don't inherit from this class yourself. Using NewEventListenerHookup() is
17 // much easier. 17 // much easier.
18 template <typename EventType> 18 template <typename EventType>
19 class EventListener { 19 class EventListener {
20 public: 20 public:
21 virtual void HandleEvent(const EventType& event) = 0; 21 virtual void HandleEvent(const EventType& event) = 0;
22
23 protected:
24 virtual ~EventListener() {}
22 }; 25 };
23 26
24 // See the -inl.h for details about the following. 27 // See the -inl.h for details about the following.
25 28
26 template <typename EventTraits, typename NotifyLock = Lock, 29 template <typename EventTraits, typename NotifyLock = Lock,
27 typename ScopedNotifyLocker = AutoLock> 30 typename ScopedNotifyLocker = AutoLock>
28 class EventChannel; 31 class EventChannel;
29 32
30 class EventListenerHookup; 33 class EventListenerHookup;
31 34
32 template <typename EventChannel, typename CallbackObject, 35 template <typename EventChannel, typename CallbackObject,
33 typename CallbackMethod> 36 typename CallbackMethod>
34 EventListenerHookup* NewEventListenerHookup(EventChannel* channel, 37 EventListenerHookup* NewEventListenerHookup(EventChannel* channel,
35 CallbackObject* cbobject, 38 CallbackObject* cbobject,
36 CallbackMethod cbmethod); 39 CallbackMethod cbmethod);
37 40
38 template <typename EventChannel, typename CallbackObject, 41 template <typename EventChannel, typename CallbackObject,
39 typename CallbackMethod, typename CallbackArg0> 42 typename CallbackMethod, typename CallbackArg0>
40 EventListenerHookup* NewEventListenerHookup(EventChannel* channel, 43 EventListenerHookup* NewEventListenerHookup(EventChannel* channel,
41 CallbackObject* cbobject, 44 CallbackObject* cbobject,
42 CallbackMethod cbmethod, 45 CallbackMethod cbmethod,
43 CallbackArg0 arg0); 46 CallbackArg0 arg0);
44 47
45 #endif // CHROME_COMMON_DEPRECATED_EVENT_SYS_H_ 48 #endif // CHROME_COMMON_DEPRECATED_EVENT_SYS_H_
OLDNEW
« no previous file with comments | « app/menus/button_menu_item_model.h ('k') | chrome/common/mach_message_source_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698