| 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 #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 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 namespace aura { | 38 namespace aura { |
| 39 | 39 |
| 40 DispatcherLinux::DispatcherLinux() | 40 DispatcherLinux::DispatcherLinux() |
| 41 : x_root_window_( | 41 : x_root_window_( |
| 42 DefaultRootWindow(base::MessagePumpX::GetDefaultXDisplay())) { | 42 DefaultRootWindow(base::MessagePumpAuraX11::GetDefaultXDisplay())) { |
| 43 base::MessagePumpX::SetDefaultDispatcher(this); | 43 base::MessagePumpAuraX11::SetDefaultDispatcher(this); |
| 44 MessageLoopForUI::current()->AddObserver(this); | 44 MessageLoopForUI::current()->AddObserver(this); |
| 45 } | 45 } |
| 46 | 46 |
| 47 DispatcherLinux::~DispatcherLinux() { | 47 DispatcherLinux::~DispatcherLinux() { |
| 48 MessageLoopForUI::current()->RemoveObserver(this); | 48 MessageLoopForUI::current()->RemoveObserver(this); |
| 49 base::MessagePumpX::SetDefaultDispatcher(NULL); | 49 base::MessagePumpAuraX11::SetDefaultDispatcher(NULL); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void DispatcherLinux::AddDispatcherForWindow( | 52 void DispatcherLinux::AddDispatcherForWindow( |
| 53 MessageLoop::Dispatcher* dispatcher, | 53 MessageLoop::Dispatcher* dispatcher, |
| 54 ::Window x_window) { | 54 ::Window x_window) { |
| 55 dispatchers_.insert(std::make_pair(x_window, dispatcher)); | 55 dispatchers_.insert(std::make_pair(x_window, dispatcher)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void DispatcherLinux::RemoveDispatcherForWindow(::Window x_window) { | 58 void DispatcherLinux::RemoveDispatcherForWindow(::Window x_window) { |
| 59 dispatchers_.erase(x_window); | 59 dispatchers_.erase(x_window); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 DispatchersMap::const_iterator it = dispatchers_.find(x_window); | 126 DispatchersMap::const_iterator it = dispatchers_.find(x_window); |
| 127 return it != dispatchers_.end() ? it->second : NULL; | 127 return it != dispatchers_.end() ? it->second : NULL; |
| 128 } | 128 } |
| 129 | 129 |
| 130 MessageLoop::Dispatcher* CreateDispatcher() { | 130 MessageLoop::Dispatcher* CreateDispatcher() { |
| 131 return new DispatcherLinux; | 131 return new DispatcherLinux; |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace aura | 134 } // namespace aura |
| OLD | NEW |