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

Side by Side Diff: base/message_pump_x.cc

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 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 #include "base/message_pump_x.h" 5 #include "base/message_pump_x.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 XEvent* xev) { 137 XEvent* xev) {
138 bool should_quit = false; 138 bool should_quit = false;
139 139
140 bool have_cookie = false; 140 bool have_cookie = false;
141 if (xev->type == GenericEvent && 141 if (xev->type == GenericEvent &&
142 XGetEventData(xev->xgeneric.display, &xev->xcookie)) { 142 XGetEventData(xev->xgeneric.display, &xev->xcookie)) {
143 have_cookie = true; 143 have_cookie = true;
144 } 144 }
145 145
146 if (!WillProcessXEvent(xev)) { 146 if (!WillProcessXEvent(xev)) {
147 MessagePumpDispatcher::DispatchStatus status = 147 DispatchStatus status = dispatcher->Dispatch(xev);
148 dispatcher->Dispatch(xev);
149 148
150 if (status == MessagePumpDispatcher::EVENT_QUIT) { 149 if (status == EVENT_QUIT) {
151 should_quit = true; 150 should_quit = true;
152 Quit(); 151 Quit();
153 } else if (status == MessagePumpDispatcher::EVENT_IGNORED) { 152 } else if (status == EVENT_IGNORED) {
154 DVLOG(1) << "Event (" << xev->type << ") not handled."; 153 DVLOG(1) << "Event (" << xev->type << ") not handled.";
155 } 154 }
156 DidProcessXEvent(xev); 155 DidProcessXEvent(xev);
157 } 156 }
158 157
159 if (have_cookie) { 158 if (have_cookie) {
160 XFreeEventData(xev->xgeneric.display, &xev->xcookie); 159 XFreeEventData(xev->xgeneric.display, &xev->xcookie);
161 } 160 }
162 161
163 return should_quit; 162 return should_quit;
(...skipping 26 matching lines...) Expand all
190 return true; 189 return true;
191 } 190 }
192 return false; 191 return false;
193 } 192 }
194 193
195 void MessagePumpX::DidProcessXEvent(XEvent* xevent) { 194 void MessagePumpX::DidProcessXEvent(XEvent* xevent) {
196 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DidProcessEvent(xevent)); 195 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DidProcessEvent(xevent));
197 } 196 }
198 197
199 } // namespace base 198 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698