| 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 "ash/test/ash_test_helper.h" | 5 #include "ash/test/ash_test_helper.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" | 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 8 #include "ash/common/test/test_session_state_delegate.h" | 8 #include "ash/common/test/test_session_state_delegate.h" |
| 9 #include "ash/common/test/test_system_tray_delegate.h" | 9 #include "ash/common/test/test_system_tray_delegate.h" |
| 10 #include "ash/common/test/wm_shell_test_api.h" | 10 #include "ash/common/test/wm_shell_test_api.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 220 } |
| 221 | 221 |
| 222 // static | 222 // static |
| 223 TestSessionStateDelegate* AshTestHelper::GetTestSessionStateDelegate() { | 223 TestSessionStateDelegate* AshTestHelper::GetTestSessionStateDelegate() { |
| 224 CHECK(WmShell::HasInstance()); | 224 CHECK(WmShell::HasInstance()); |
| 225 return static_cast<TestSessionStateDelegate*>( | 225 return static_cast<TestSessionStateDelegate*>( |
| 226 WmShell::Get()->GetSessionStateDelegate()); | 226 WmShell::Get()->GetSessionStateDelegate()); |
| 227 } | 227 } |
| 228 | 228 |
| 229 aura::Window* AshTestHelper::CurrentContext() { | 229 aura::Window* AshTestHelper::CurrentContext() { |
| 230 aura::Window* root_window = Shell::GetTargetRootWindow(); | 230 aura::Window* root_window = Shell::GetRootWindowForNewWindows(); |
| 231 if (!root_window) | 231 if (!root_window) |
| 232 root_window = Shell::GetPrimaryRootWindow(); | 232 root_window = Shell::GetPrimaryRootWindow(); |
| 233 DCHECK(root_window); | 233 DCHECK(root_window); |
| 234 return root_window; | 234 return root_window; |
| 235 } | 235 } |
| 236 | 236 |
| 237 void AshTestHelper::UpdateDisplayForMash(const std::string& display_spec) { | 237 void AshTestHelper::UpdateDisplayForMash(const std::string& display_spec) { |
| 238 // TODO(erg): This is not equivalent to display::DisplayManager:: | 238 // TODO(erg): This is not equivalent to display::DisplayManager:: |
| 239 // UpdateDisplaysWith(). This does not calculate all the internal metric | 239 // UpdateDisplaysWith(). This does not calculate all the internal metric |
| 240 // changes, does not calculate focus changes and does not dispatch to all the | 240 // changes, does not calculate focus changes and does not dispatch to all the |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 std::set<RootWindowController*> roots = | 364 std::set<RootWindowController*> roots = |
| 365 window_manager_app_->window_manager()->GetRootWindowControllers(); | 365 window_manager_app_->window_manager()->GetRootWindowControllers(); |
| 366 std::vector<RootWindowController*> ordered_roots; | 366 std::vector<RootWindowController*> ordered_roots; |
| 367 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); | 367 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); |
| 368 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); | 368 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); |
| 369 return ordered_roots; | 369 return ordered_roots; |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace test | 372 } // namespace test |
| 373 } // namespace ash | 373 } // namespace ash |
| OLD | NEW |