| 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: | 21 public: |
| 22 DispatcherLinux(); | 22 DispatcherLinux(); |
| 23 virtual ~DispatcherLinux(); | 23 virtual ~DispatcherLinux(); |
| 24 | 24 |
| 25 void WindowDispatcherCreated(::Window window, | 25 void WindowDispatcherCreated(::Window window, |
| 26 MessageLoop::Dispatcher* dispatcher); | 26 MessageLoop::Dispatcher* dispatcher); |
| 27 void WindowDispatcherDestroying(::Window window); | 27 void WindowDispatcherDestroying(::Window window); |
| 28 | 28 |
| 29 // Overridden from MessageLoop::Dispatcher: | 29 // Overridden from MessageLoop::Dispatcher: |
| 30 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( | 30 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
| 31 XEvent* xev) OVERRIDE; | |
| 32 | 31 |
| 33 private: | 32 private: |
| 34 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap; | 33 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap; |
| 35 | 34 |
| 36 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const; | 35 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const; |
| 37 | 36 |
| 38 DispatchersMap dispatchers_; | 37 DispatchersMap dispatchers_; |
| 39 | 38 |
| 40 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux); | 39 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux); |
| 41 }; | 40 }; |
| 42 | 41 |
| 43 } // namespace aura | 42 } // namespace aura |
| 44 | 43 |
| 45 #endif // UI_AURA_DISPATCHER_LINUX_H_ | 44 #endif // UI_AURA_DISPATCHER_LINUX_H_ |
| OLD | NEW |