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

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

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_x11.h ('k') | chrome/browser/chromeos/device_uma.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) 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 #include "base/message_loop/message_pump_x11.h" 5 #include "base/message_loop/message_pump_x11.h"
6 6
7 #include <glib.h> 7 #include <glib.h>
8 #include <X11/X.h> 8 #include <X11/X.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/XKBlib.h> 10 #include <X11/XKBlib.h>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #endif 59 #endif
60 60
61 void MessagePumpX11::AddObserver(MessagePumpObserver* observer) { 61 void MessagePumpX11::AddObserver(MessagePumpObserver* observer) {
62 observers_.AddObserver(observer); 62 observers_.AddObserver(observer);
63 } 63 }
64 64
65 void MessagePumpX11::RemoveObserver(MessagePumpObserver* observer) { 65 void MessagePumpX11::RemoveObserver(MessagePumpObserver* observer) {
66 observers_.RemoveObserver(observer); 66 observers_.RemoveObserver(observer);
67 } 67 }
68 68
69 bool MessagePumpX11::WillProcessXEvent(XEvent* xevent) { 69 void MessagePumpX11::WillProcessXEvent(XEvent* xevent) {
70 if (!observers_.might_have_observers()) 70 FOR_EACH_OBSERVER(MessagePumpObserver, observers_, WillProcessEvent(xevent));
71 return false;
72 ObserverListBase<MessagePumpObserver>::Iterator it(observers_);
73 MessagePumpObserver* obs;
74 while ((obs = it.GetNext()) != NULL) {
75 if (obs->WillProcessEvent(xevent))
76 return true;
77 }
78 return false;
79 } 71 }
80 72
81 void MessagePumpX11::DidProcessXEvent(XEvent* xevent) { 73 void MessagePumpX11::DidProcessXEvent(XEvent* xevent) {
82 FOR_EACH_OBSERVER(MessagePumpObserver, observers_, DidProcessEvent(xevent)); 74 FOR_EACH_OBSERVER(MessagePumpObserver, observers_, DidProcessEvent(xevent));
83 } 75 }
84 76
85 } // namespace base 77 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_x11.h ('k') | chrome/browser/chromeos/device_uma.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698