| 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/aura/wm_shell_aura.h" | 8 #include "ash/aura/wm_shell_aura.h" |
| 9 #include "ash/common/test/test_session_state_delegate.h" | 9 #include "ash/common/test/test_session_state_delegate.h" |
| 10 #include "ash/common/test/test_system_tray_delegate.h" | 10 #include "ash/common/test/test_system_tray_delegate.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 ManagedDisplayInfo::CreateFromSpec(display_spec); | 361 ManagedDisplayInfo::CreateFromSpec(display_spec); |
| 362 gfx::Rect bounds = display_info.bounds_in_native(); | 362 gfx::Rect bounds = display_info.bounds_in_native(); |
| 363 bounds.set_x(*next_x); | 363 bounds.set_x(*next_x); |
| 364 *next_x += bounds.size().width(); | 364 *next_x += bounds.size().width(); |
| 365 display::Display updated_display = | 365 display::Display updated_display = |
| 366 root_window_controller->GetWindow()->GetDisplayNearestWindow(); | 366 root_window_controller->GetWindow()->GetDisplayNearestWindow(); |
| 367 gfx::Insets work_area_insets = updated_display.GetWorkAreaInsets(); | 367 gfx::Insets work_area_insets = updated_display.GetWorkAreaInsets(); |
| 368 updated_display.set_bounds(bounds); | 368 updated_display.set_bounds(bounds); |
| 369 updated_display.UpdateWorkAreaFromInsets(work_area_insets); | 369 updated_display.UpdateWorkAreaFromInsets(work_area_insets); |
| 370 updated_display.set_device_scale_factor(display_info.device_scale_factor()); | 370 updated_display.set_device_scale_factor(display_info.device_scale_factor()); |
| 371 root_window_controller->GetWindow()->SetBounds(gfx::Rect(bounds.size())); | 371 window_manager_app_->window_manager()->OnWmDisplayModified(updated_display); |
| 372 ScreenMus* screen = window_manager_app_->window_manager()->screen_.get(); | |
| 373 const bool is_primary = | |
| 374 screen->display_list().FindDisplayById(updated_display.id()) == | |
| 375 screen->display_list().GetPrimaryDisplayIterator(); | |
| 376 screen->display_list().UpdateDisplay( | |
| 377 updated_display, is_primary ? display::DisplayList::Type::PRIMARY | |
| 378 : display::DisplayList::Type::NOT_PRIMARY); | |
| 379 } | 372 } |
| 380 | 373 |
| 381 std::vector<RootWindowController*> AshTestHelper::GetRootsOrderedByDisplayId() { | 374 std::vector<RootWindowController*> AshTestHelper::GetRootsOrderedByDisplayId() { |
| 382 std::set<RootWindowController*> roots = | 375 std::set<RootWindowController*> roots = |
| 383 window_manager_app_->window_manager()->GetRootWindowControllers(); | 376 window_manager_app_->window_manager()->GetRootWindowControllers(); |
| 384 std::vector<RootWindowController*> ordered_roots; | 377 std::vector<RootWindowController*> ordered_roots; |
| 385 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); | 378 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); |
| 386 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); | 379 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); |
| 387 return ordered_roots; | 380 return ordered_roots; |
| 388 } | 381 } |
| 389 | 382 |
| 390 } // namespace test | 383 } // namespace test |
| 391 } // namespace ash | 384 } // namespace ash |
| OLD | NEW |