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

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: sync, addressed comments 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
« no previous file with comments | « base/message_pump_x.h ('k') | chrome/browser/ui/views/simple_message_box_views.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_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 if (!dispatcher->Dispatch(xev)) {
148 dispatcher->Dispatch(xev);
149
150 if (status == MessagePumpDispatcher::EVENT_QUIT) {
151 should_quit = true; 148 should_quit = true;
152 Quit(); 149 Quit();
153 } else if (status == MessagePumpDispatcher::EVENT_IGNORED) {
154 DVLOG(1) << "Event (" << xev->type << ") not handled.";
155 } 150 }
156 DidProcessXEvent(xev); 151 DidProcessXEvent(xev);
157 } 152 }
158 153
159 if (have_cookie) { 154 if (have_cookie) {
160 XFreeEventData(xev->xgeneric.display, &xev->xcookie); 155 XFreeEventData(xev->xgeneric.display, &xev->xcookie);
161 } 156 }
162 157
163 return should_quit; 158 return should_quit;
164 } 159 }
(...skipping 25 matching lines...) Expand all
190 return true; 185 return true;
191 } 186 }
192 return false; 187 return false;
193 } 188 }
194 189
195 void MessagePumpX::DidProcessXEvent(XEvent* xevent) { 190 void MessagePumpX::DidProcessXEvent(XEvent* xevent) {
196 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DidProcessEvent(xevent)); 191 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DidProcessEvent(xevent));
197 } 192 }
198 193
199 } // namespace base 194 } // namespace base
OLDNEW
« no previous file with comments | « base/message_pump_x.h ('k') | chrome/browser/ui/views/simple_message_box_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698