Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: ui/views/test/ui_controls_factory_desktop_aurax11.cc

Issue 2924343002: Move ui::GetAtom to gfx::GetAtom (Closed)
Patch Set: fix CrOs build Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/platform_window/x11/x11_window_base.cc ('k') | ui/views/test/x11_property_change_waiter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // X macro fail. 8 // X macro fail.
9 #if defined(RootWindow) 9 #if defined(RootWindow)
10 #undef RootWindow 10 #undef RootWindow
11 #endif 11 #endif
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "ui/aura/client/screen_position_client.h" 16 #include "ui/aura/client/screen_position_client.h"
17 #include "ui/aura/env.h" 17 #include "ui/aura/env.h"
18 #include "ui/aura/test/aura_test_utils.h" 18 #include "ui/aura/test/aura_test_utils.h"
19 #include "ui/aura/test/ui_controls_factory_aura.h" 19 #include "ui/aura/test/ui_controls_factory_aura.h"
20 #include "ui/aura/test/x11_event_sender.h" 20 #include "ui/aura/test/x11_event_sender.h"
21 #include "ui/aura/window_event_dispatcher.h" 21 #include "ui/aura/window_event_dispatcher.h"
22 #include "ui/base/test/ui_controls_aura.h" 22 #include "ui/base/test/ui_controls_aura.h"
23 #include "ui/base/x/x11_util.h" 23 #include "ui/base/x/x11_util.h"
24 #include "ui/compositor/dip_util.h" 24 #include "ui/compositor/dip_util.h"
25 #include "ui/events/keycodes/keyboard_code_conversion_x.h" 25 #include "ui/events/keycodes/keyboard_code_conversion_x.h"
26 #include "ui/events/test/platform_event_waiter.h" 26 #include "ui/events/test/platform_event_waiter.h"
27 #include "ui/gfx/x/x11_atom_cache.h"
27 #include "ui/gfx/x/x11_connection.h" 28 #include "ui/gfx/x/x11_connection.h"
28 #include "ui/views/test/test_desktop_screen_x11.h" 29 #include "ui/views/test/test_desktop_screen_x11.h"
29 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" 30 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
30 31
31 namespace views { 32 namespace views {
32 namespace test { 33 namespace test {
33 namespace { 34 namespace {
34 35
35 using ui_controls::DOWN; 36 using ui_controls::DOWN;
36 using ui_controls::LEFT; 37 using ui_controls::LEFT;
37 using ui_controls::MIDDLE; 38 using ui_controls::MIDDLE;
38 using ui_controls::MouseButton; 39 using ui_controls::MouseButton;
39 using ui_controls::RIGHT; 40 using ui_controls::RIGHT;
40 using ui_controls::UIControlsAura; 41 using ui_controls::UIControlsAura;
41 using ui_controls::UP; 42 using ui_controls::UP;
42 43
43 // Mask of the buttons currently down. 44 // Mask of the buttons currently down.
44 unsigned button_down_mask = 0; 45 unsigned button_down_mask = 0;
45 46
46 // Returns atom that indidates that the XEvent is marker event. 47 // Returns atom that indidates that the XEvent is marker event.
47 Atom MarkerEventAtom() { 48 Atom MarkerEventAtom() {
48 return ui::GetAtom("marker_event"); 49 return gfx::GetAtom("marker_event");
49 } 50 }
50 51
51 // Returns true when the event is a marker event. 52 // Returns true when the event is a marker event.
52 bool Matcher(const base::NativeEvent& event) { 53 bool Matcher(const base::NativeEvent& event) {
53 return event->xany.type == ClientMessage && 54 return event->xany.type == ClientMessage &&
54 event->xclient.message_type == MarkerEventAtom(); 55 event->xclient.message_type == MarkerEventAtom();
55 } 56 }
56 57
57 class UIControlsDesktopX11 : public UIControlsAura { 58 class UIControlsDesktopX11 : public UIControlsAura {
58 public: 59 public:
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 286
286 UIControlsAura* CreateUIControlsDesktopAura() { 287 UIControlsAura* CreateUIControlsDesktopAura() {
287 // The constructor of UIControlsDesktopX11 needs X11 connection to be 288 // The constructor of UIControlsDesktopX11 needs X11 connection to be
288 // initialized. 289 // initialized.
289 gfx::InitializeThreadedX11(); 290 gfx::InitializeThreadedX11();
290 return new UIControlsDesktopX11(); 291 return new UIControlsDesktopX11();
291 } 292 }
292 293
293 } // namespace test 294 } // namespace test
294 } // namespace views 295 } // namespace views
OLDNEW
« no previous file with comments | « ui/platform_window/x11/x11_window_base.cc ('k') | ui/views/test/x11_property_change_waiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698