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

Side by Side Diff: ash/display/display_controller_unittest.cc

Issue 23460052: Move XID, XDisplay, GetXDisplay and a few other types to ui/gfx/x/x11_types.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sdf Created 7 years, 3 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 | « ash/display/display_controller.cc ('k') | ash/display/mirror_window_controller.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 (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 "ash/display/display_controller.h" 5 #include "ash/display/display_controller.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/display_info.h" 8 #include "ash/display/display_info.h"
9 #include "ash/display/display_layout_store.h" 9 #include "ash/display/display_layout_store.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 11 matching lines...) Expand all
22 #include "ui/aura/env.h" 22 #include "ui/aura/env.h"
23 #include "ui/aura/root_window.h" 23 #include "ui/aura/root_window.h"
24 #include "ui/aura/test/event_generator.h" 24 #include "ui/aura/test/event_generator.h"
25 #include "ui/aura/window_tracker.h" 25 #include "ui/aura/window_tracker.h"
26 #include "ui/events/event_handler.h" 26 #include "ui/events/event_handler.h"
27 #include "ui/gfx/display.h" 27 #include "ui/gfx/display.h"
28 #include "ui/gfx/screen.h" 28 #include "ui/gfx/screen.h"
29 #include "ui/views/widget/widget.h" 29 #include "ui/views/widget/widget.h"
30 30
31 #if defined(USE_X11) 31 #if defined(USE_X11)
32 #include "ui/base/x/x11_util.h" 32 #include "ui/gfx/x/x11_types.h"
33 #include <X11/Xlib.h> 33 #include <X11/Xlib.h>
34 #undef RootWindow 34 #undef RootWindow
35 #endif 35 #endif
36 36
37 namespace ash { 37 namespace ash {
38 namespace { 38 namespace {
39 39
40 const char kDesktopBackgroundView[] = "DesktopBackgroundView"; 40 const char kDesktopBackgroundView[] = "DesktopBackgroundView";
41 41
42 template<typename T> 42 template<typename T>
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 #if defined(USE_X11) 281 #if defined(USE_X11)
282 void GetPrimaryAndSeconary(aura::RootWindow** primary, 282 void GetPrimaryAndSeconary(aura::RootWindow** primary,
283 aura::RootWindow** secondary) { 283 aura::RootWindow** secondary) {
284 *primary = Shell::GetPrimaryRootWindow(); 284 *primary = Shell::GetPrimaryRootWindow();
285 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 285 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
286 *secondary = root_windows[0] == *primary ? root_windows[1] : root_windows[0]; 286 *secondary = root_windows[0] == *primary ? root_windows[1] : root_windows[0];
287 } 287 }
288 288
289 std::string GetXWindowName(aura::RootWindow* window) { 289 std::string GetXWindowName(aura::RootWindow* window) {
290 char* name = NULL; 290 char* name = NULL;
291 XFetchName(ui::GetXDisplay(), window->GetAcceleratedWidget(), &name); 291 XFetchName(gfx::GetXDisplay(), window->GetAcceleratedWidget(), &name);
292 std::string ret(name); 292 std::string ret(name);
293 XFree(name); 293 XFree(name);
294 return ret; 294 return ret;
295 } 295 }
296 #endif 296 #endif
297 297
298 } // namespace 298 } // namespace
299 299
300 typedef test::AshTestBase DisplayControllerTest; 300 typedef test::AshTestBase DisplayControllerTest;
301 301
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 EXPECT_EQ("aura_root_0", GetXWindowName(primary)); 1235 EXPECT_EQ("aura_root_0", GetXWindowName(primary));
1236 EXPECT_EQ("aura_root_x", GetXWindowName(secondary)); 1236 EXPECT_EQ("aura_root_x", GetXWindowName(secondary));
1237 1237
1238 // Switching back to single display. 1238 // Switching back to single display.
1239 UpdateDisplay("300x400"); 1239 UpdateDisplay("300x400");
1240 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow())); 1240 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow()));
1241 } 1241 }
1242 #endif 1242 #endif
1243 1243
1244 } // namespace ash 1244 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/display/mirror_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698