OLD | NEW |
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 UI_AURA_DISPATCHER_LINUX_H_ | 5 #ifndef UI_AURA_DISPATCHER_LINUX_H_ |
6 #define UI_AURA_DISPATCHER_LINUX_H_ | 6 #define UI_AURA_DISPATCHER_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
11 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 11 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
12 #undef RootWindow | 12 #undef RootWindow |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
17 | 17 |
18 namespace aura { | 18 namespace aura { |
19 | 19 |
20 class DispatcherLinux : public MessageLoop::Dispatcher { | 20 class DispatcherLinux : public MessageLoop::Dispatcher, |
| 21 public base::MessagePumpObserver { |
21 public: | 22 public: |
22 DispatcherLinux(); | 23 DispatcherLinux(); |
23 virtual ~DispatcherLinux(); | 24 virtual ~DispatcherLinux(); |
24 | 25 |
25 void WindowDispatcherCreated(::Window window, | 26 void WindowDispatcherCreated(::Window window, |
26 MessageLoop::Dispatcher* dispatcher); | 27 MessageLoop::Dispatcher* dispatcher); |
27 void WindowDispatcherDestroying(::Window window); | 28 void WindowDispatcherDestroying(::Window window); |
28 | 29 |
29 // Overridden from MessageLoop::Dispatcher: | 30 // Overridden from MessageLoop::Dispatcher: |
30 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; | 31 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
31 | 32 |
| 33 // Overridden from base::MessagePumpObserver: |
| 34 virtual base::EventStatus WillProcessEvent( |
| 35 const base::NativeEvent& event) OVERRIDE; |
| 36 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; |
| 37 |
32 private: | 38 private: |
33 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap; | 39 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap; |
34 | 40 |
35 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const; | 41 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const; |
36 | 42 |
37 DispatchersMap dispatchers_; | 43 DispatchersMap dispatchers_; |
38 | 44 |
39 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux); | 45 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux); |
40 }; | 46 }; |
41 | 47 |
42 } // namespace aura | 48 } // namespace aura |
43 | 49 |
44 #endif // UI_AURA_DISPATCHER_LINUX_H_ | 50 #endif // UI_AURA_DISPATCHER_LINUX_H_ |
OLD | NEW |