| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <X11/keysym.h> | 5 #include <X11/keysym.h> |
| 6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/aura/client/screen_position_client.h" | 11 #include "ui/aura/client/screen_position_client.h" |
| 12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 13 #include "ui/aura/test/aura_test_utils.h" | 13 #include "ui/aura/test/aura_test_utils.h" |
| 14 #include "ui/aura/test/ui_controls_factory_aura.h" | 14 #include "ui/aura/test/ui_controls_factory_aura.h" |
| 15 #include "ui/aura/test/x11_event_sender.h" | 15 #include "ui/aura/test/x11_event_sender.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_tree_host.h" | 17 #include "ui/aura/window_tree_host.h" |
| 18 #include "ui/base/test/ui_controls_aura.h" | 18 #include "ui/base/test/ui_controls_aura.h" |
| 19 #include "ui/base/x/x11_util.h" | |
| 20 #include "ui/compositor/dip_util.h" | 19 #include "ui/compositor/dip_util.h" |
| 21 #include "ui/events/keycodes/keyboard_code_conversion_x.h" | 20 #include "ui/events/keycodes/keyboard_code_conversion_x.h" |
| 22 #include "ui/events/test/platform_event_waiter.h" | 21 #include "ui/events/test/platform_event_waiter.h" |
| 22 #include "ui/gfx/x/x11_atom_cache.h" |
| 23 | 23 |
| 24 namespace aura { | 24 namespace aura { |
| 25 namespace test { | 25 namespace test { |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 using ui_controls::DOWN; | 28 using ui_controls::DOWN; |
| 29 using ui_controls::LEFT; | 29 using ui_controls::LEFT; |
| 30 using ui_controls::MIDDLE; | 30 using ui_controls::MIDDLE; |
| 31 using ui_controls::MouseButton; | 31 using ui_controls::MouseButton; |
| 32 using ui_controls::RIGHT; | 32 using ui_controls::RIGHT; |
| 33 using ui_controls::UIControlsAura; | 33 using ui_controls::UIControlsAura; |
| 34 using ui_controls::UP; | 34 using ui_controls::UP; |
| 35 | 35 |
| 36 // Mask of the buttons currently down. | 36 // Mask of the buttons currently down. |
| 37 unsigned button_down_mask = 0; | 37 unsigned button_down_mask = 0; |
| 38 | 38 |
| 39 // Returns atom that indidates that the XEvent is marker event. | 39 // Returns atom that indidates that the XEvent is marker event. |
| 40 Atom MarkerEventAtom() { | 40 Atom MarkerEventAtom() { |
| 41 return ui::GetAtom("marker_event"); | 41 return gfx::GetAtom("marker_event"); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // Returns true when the event is a marker event. | 44 // Returns true when the event is a marker event. |
| 45 bool Matcher(const base::NativeEvent& event) { | 45 bool Matcher(const base::NativeEvent& event) { |
| 46 return event->xany.type == ClientMessage && | 46 return event->xany.type == ClientMessage && |
| 47 event->xclient.message_type == MarkerEventAtom(); | 47 event->xclient.message_type == MarkerEventAtom(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 class UIControlsX11 : public UIControlsAura { | 50 class UIControlsX11 : public UIControlsAura { |
| 51 public: | 51 public: |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 } // namespace | 226 } // namespace |
| 227 | 227 |
| 228 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 228 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
| 229 return new UIControlsX11(host); | 229 return new UIControlsX11(host); |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace test | 232 } // namespace test |
| 233 } // namespace aura | 233 } // namespace aura |
| OLD | NEW |