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

Side by Side Diff: base/message_loop/message_pump_x11.h

Issue 223483002: base: Do not allow MessagePumpObservers to consume events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r262009 Created 6 years, 8 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 | « base/message_loop/message_pump_observer.h ('k') | base/message_loop/message_pump_x11.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H
6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H
7 7
8 #include <bitset> 8 #include <bitset>
9 #include <map> 9 #include <map>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Returns the UI or GPU message pump. 42 // Returns the UI or GPU message pump.
43 static MessagePumpX11* Current(); 43 static MessagePumpX11* Current();
44 44
45 // Adds an Observer, which will start receiving notifications immediately. 45 // Adds an Observer, which will start receiving notifications immediately.
46 void AddObserver(MessagePumpObserver* observer); 46 void AddObserver(MessagePumpObserver* observer);
47 47
48 // Removes an Observer. It is safe to call this method while an Observer is 48 // Removes an Observer. It is safe to call this method while an Observer is
49 // receiving a notification callback. 49 // receiving a notification callback.
50 void RemoveObserver(MessagePumpObserver* observer); 50 void RemoveObserver(MessagePumpObserver* observer);
51 51
52 // Sends the event to the observers. If an observer returns true, then it does 52 // Sends the event to the observers.
53 // not send the event to any other observers and returns true. Returns false 53 void WillProcessXEvent(XEvent* xevent);
54 // if no observer returns true.
55 bool WillProcessXEvent(XEvent* xevent);
56 void DidProcessXEvent(XEvent* xevent); 54 void DidProcessXEvent(XEvent* xevent);
57 55
58 private: 56 private:
59 // List of observers. 57 // List of observers.
60 ObserverList<MessagePumpObserver> observers_; 58 ObserverList<MessagePumpObserver> observers_;
61 59
62 DISALLOW_COPY_AND_ASSIGN(MessagePumpX11); 60 DISALLOW_COPY_AND_ASSIGN(MessagePumpX11);
63 }; 61 };
64 62
65 #if !defined(TOOLKIT_GTK) 63 #if !defined(TOOLKIT_GTK)
66 typedef MessagePumpX11 MessagePumpForUI; 64 typedef MessagePumpX11 MessagePumpForUI;
67 #endif 65 #endif
68 66
69 } // namespace base 67 } // namespace base
70 68
71 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H 69 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_observer.h ('k') | base/message_loop/message_pump_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698