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

Side by Side Diff: ui/aura/dispatcher_linux.cc

Issue 10143001: Work in progress: Adds MessagePumpDispatcher::ShouldExit(). This is used to handle the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « ui/aura/dispatcher_linux.h ('k') | ui/aura/monitor_change_observer_x11.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 "ui/aura/dispatcher_linux.h" 5 #include "ui/aura/dispatcher_linux.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 8
9 #include "ui/base/events.h" 9 #include "ui/base/events.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 it != dispatchers_.end(); ++it) { 45 it != dispatchers_.end(); ++it) {
46 it->second->Dispatch(xev); 46 it->second->Dispatch(xev);
47 } 47 }
48 return true; 48 return true;
49 } 49 }
50 50
51 MessageLoop::Dispatcher* dispatcher = GetDispatcherForXEvent(xev); 51 MessageLoop::Dispatcher* dispatcher = GetDispatcherForXEvent(xev);
52 return dispatcher ? dispatcher->Dispatch(xev) : true; 52 return dispatcher ? dispatcher->Dispatch(xev) : true;
53 } 53 }
54 54
55 bool DispatcherLinux::ShouldExit() {
56 return false;
57 }
58
55 MessageLoop::Dispatcher* DispatcherLinux::GetDispatcherForXEvent( 59 MessageLoop::Dispatcher* DispatcherLinux::GetDispatcherForXEvent(
56 XEvent* xev) const { 60 XEvent* xev) const {
57 ::Window window = xev->xany.window; 61 ::Window window = xev->xany.window;
58 if (xev->type == GenericEvent) { 62 if (xev->type == GenericEvent) {
59 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(xev->xcookie.data); 63 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(xev->xcookie.data);
60 window = xievent->event; 64 window = xievent->event;
61 } 65 }
62 DispatchersMap::const_iterator it = dispatchers_.find(window); 66 DispatchersMap::const_iterator it = dispatchers_.find(window);
63 return it != dispatchers_.end() ? it->second : NULL; 67 return it != dispatchers_.end() ? it->second : NULL;
64 } 68 }
65 69
66 MessageLoop::Dispatcher* CreateDispatcher() { 70 MessageLoop::Dispatcher* CreateDispatcher() {
67 return new DispatcherLinux; 71 return new DispatcherLinux;
68 } 72 }
69 73
70 } // namespace aura 74 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/dispatcher_linux.h ('k') | ui/aura/monitor_change_observer_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698