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

Side by Side Diff: base/message_pump_observer.h

Issue 8021009: Consolidate message observer API for win and aura (and touch). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 2 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_MESSAGE_PUMP_OBSERVER_H
6 #define BASE_MESSAGE_PUMP_OBSERVER_H
7
8 #if defined(USE_X11)
9 typedef union _XEvent XEvent;
10 #endif
11
12 namespace base {
13
14 #if defined(OS_WIN)
15 typedef MSG NativeEvent;
16 #elif defined(USE_X11)
17 typedef XEvent* NativeEvent;
18 #endif
19
20 enum EventStatus {
21 EVENT_CONTINUE, // The event should be dispatched as normal.
22 #if defined(USE_X11)
23 EVENT_HANDLED // The event should not be processed any farther.
24 #endif
25 };
26
27 // A MessagePumpObserver is an object that receives global
28 // notifications from the UI MessageLoop with MessagePumpWin or
29 // MessagePumpX.
30 //
31 // NOTE: An Observer implementation should be extremely fast!
32 //
33 // For use with MessagePumpX, please see message_pump_glib.h for more
34 // info about how this is invoked in this environment.
35 class BASE_EXPORT MessagePumpObserver {
36 public:
37 // This method is called before processing a NativeEvent. If the
38 // method returns EVENT_HANDLED, it indicates the event has already
39 // been handled, so the event is not processed any farther. If the
40 // method returns EVENT_CONTINUE, the event dispatching proceeds as
41 // normal.
42 virtual EventStatus WillProcessEvent(const NativeEvent& event) = 0;
43
44 // This method is called after processing a message. This method
45 // will not be called if WillProcessEvent returns EVENT_HANDLED.
46 virtual void DidProcessEvent(const NativeEvent& event) = 0;
47
48 protected:
49 virtual ~MessagePumpObserver() {}
50 };
51
52 } // namespace base
53
54 #endif // BASE_MESSAGE_PUMP_OBSERVER_VIEWS_H
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | base/message_pump_win.h » ('j') | views/widget/native_widget_gtk.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698