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 "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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |