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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 #if defined(USE_X11) | 283 #if defined(USE_X11) |
284 void GetPrimaryAndSeconary(aura::Window** primary, | 284 void GetPrimaryAndSeconary(aura::Window** primary, |
285 aura::Window** secondary) { | 285 aura::Window** secondary) { |
286 *primary = Shell::GetPrimaryRootWindow(); | 286 *primary = Shell::GetPrimaryRootWindow(); |
287 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 287 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
288 *secondary = root_windows[0] == *primary ? root_windows[1] : root_windows[0]; | 288 *secondary = root_windows[0] == *primary ? root_windows[1] : root_windows[0]; |
289 } | 289 } |
290 | 290 |
291 std::string GetXWindowName(aura::RootWindow* window) { | 291 std::string GetXWindowName(aura::RootWindow* window) { |
292 char* name = NULL; | 292 char* name = NULL; |
293 XFetchName(gfx::GetXDisplay(), window->GetAcceleratedWidget(), &name); | 293 XFetchName(gfx::GetXDisplay(), window->host()->GetAcceleratedWidget(), &name); |
294 std::string ret(name); | 294 std::string ret(name); |
295 XFree(name); | 295 XFree(name); |
296 return ret; | 296 return ret; |
297 } | 297 } |
298 #endif | 298 #endif |
299 | 299 |
300 } // namespace | 300 } // namespace |
301 | 301 |
302 typedef test::AshTestBase DisplayControllerTest; | 302 typedef test::AshTestBase DisplayControllerTest; |
303 | 303 |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetDispatcher())); | 1284 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetDispatcher())); |
1285 | 1285 |
1286 // Switching back to single display. | 1286 // Switching back to single display. |
1287 UpdateDisplay("300x400"); | 1287 UpdateDisplay("300x400"); |
1288 EXPECT_EQ("aura_root_0", GetXWindowName( | 1288 EXPECT_EQ("aura_root_0", GetXWindowName( |
1289 Shell::GetPrimaryRootWindow()->GetDispatcher())); | 1289 Shell::GetPrimaryRootWindow()->GetDispatcher())); |
1290 } | 1290 } |
1291 #endif | 1291 #endif |
1292 | 1292 |
1293 } // namespace ash | 1293 } // namespace ash |
OLD | NEW |