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

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: 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
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 private: 80 private:
81 typedef std::map<unsigned long, MessagePumpDispatcher*> DispatchersMap; 81 typedef std::map<unsigned long, MessagePumpDispatcher*> DispatchersMap;
82 82
83 // Initializes the glib event source for X. 83 // Initializes the glib event source for X.
84 void InitXSource(); 84 void InitXSource();
85 85
86 // Dispatches the event to the specified dispatcher. 86 // Dispatches the event to the specified dispatcher.
87 void ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event); 87 void ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event);
88 88
89 // Sends the event to the observers. If an observer returns true, then it does 89 // Sends the event to the observers.
90 // not send the event to any other observers and returns true. Returns false 90 void WillProcessXEvent(XEvent* xevent);
91 // if no observer returns true.
92 bool WillProcessXEvent(XEvent* xevent);
93 void DidProcessXEvent(XEvent* xevent); 91 void DidProcessXEvent(XEvent* xevent);
94 92
95 // Returns the Dispatcher based on the event's target window. 93 // Returns the Dispatcher based on the event's target window.
96 MessagePumpDispatcher* GetDispatcherForXEvent(const NativeEvent& xev) const; 94 MessagePumpDispatcher* GetDispatcherForXEvent(const NativeEvent& xev) const;
97 95
98 ObserverList<MessagePumpObserver>& observers() { return observers_; } 96 ObserverList<MessagePumpObserver>& observers() { return observers_; }
99 97
100 // Overridden from MessagePumpDispatcher: 98 // Overridden from MessagePumpDispatcher:
101 virtual uint32_t Dispatch(const NativeEvent& event) OVERRIDE; 99 virtual uint32_t Dispatch(const NativeEvent& event) OVERRIDE;
102 100
(...skipping 18 matching lines...) Expand all
121 DISALLOW_COPY_AND_ASSIGN(MessagePumpX11); 119 DISALLOW_COPY_AND_ASSIGN(MessagePumpX11);
122 }; 120 };
123 121
124 #if !defined(TOOLKIT_GTK) 122 #if !defined(TOOLKIT_GTK)
125 typedef MessagePumpX11 MessagePumpForUI; 123 typedef MessagePumpX11 MessagePumpForUI;
126 #endif 124 #endif
127 125
128 } // namespace base 126 } // namespace base
129 127
130 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H 128 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698