| 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 #include "ui/aura/env.h" | |
| 18 | 17 |
| 19 namespace aura { | 18 namespace aura { |
| 20 | 19 |
| 21 class RootWindowHostLinux; | 20 class DispatcherLinux : public MessageLoop::Dispatcher { |
| 22 | |
| 23 class DispatcherLinux : public Dispatcher { | |
| 24 public: | 21 public: |
| 25 DispatcherLinux(); | 22 DispatcherLinux(); |
| 26 virtual ~DispatcherLinux(); | 23 virtual ~DispatcherLinux(); |
| 27 | 24 |
| 28 void RootWindowHostCreated(::Window window, | 25 void WindowDispatcherCreated(::Window window, |
| 29 ::Window root, | 26 MessageLoop::Dispatcher* dispatcher); |
| 30 RootWindowHostLinux* host); | 27 void WindowDispatcherDestroying(::Window window); |
| 31 void RootWindowHostDestroying(::Window window, ::Window root); | |
| 32 | 28 |
| 33 // Overridden from MessageLoop::Dispatcher: | 29 // Overridden from MessageLoop::Dispatcher: |
| 34 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( | 30 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( |
| 35 XEvent* xev) OVERRIDE; | 31 XEvent* xev) OVERRIDE; |
| 36 | 32 |
| 37 private: | 33 private: |
| 38 typedef std::map< ::Window, RootWindowHostLinux* > HostsMap; | 34 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap; |
| 39 | 35 |
| 40 RootWindowHostLinux* GetRootWindowHostForXEvent(XEvent* xev) const; | 36 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const; |
| 41 | 37 |
| 42 HostsMap hosts_; | 38 DispatchersMap dispatchers_; |
| 43 | 39 |
| 44 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux); | 40 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux); |
| 45 }; | 41 }; |
| 46 | 42 |
| 47 } // namespace aura | 43 } // namespace aura |
| 48 | 44 |
| 49 #endif // UI_AURA_DISPATCHER_LINUX_H_ | 45 #endif // UI_AURA_DISPATCHER_LINUX_H_ |
| OLD | NEW |