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

Side by Side Diff: ash/test/ash_test_helper.cc

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: remove ash:: Created 3 years, 9 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/sticky_keys/sticky_keys_overlay.cc ('k') | ash/test/ui_controls_factory_ash.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 "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
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
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
OLDNEW
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay.cc ('k') | ash/test/ui_controls_factory_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698