| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus/test/wm_test_base.h" | 5 #include "ash/mus/test/wm_test_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/mus/root_window_controller.h" | 10 #include "ash/mus/root_window_controller.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 std::vector<RootWindowController*> roots = | 110 std::vector<RootWindowController*> roots = |
| 111 WmTestBase::GetRootsOrderedByDisplayId(); | 111 WmTestBase::GetRootsOrderedByDisplayId(); |
| 112 roots[0]->display_.set_bounds(bounds); | 112 roots[0]->display_.set_bounds(bounds); |
| 113 gfx::Rect work_area(bounds); | 113 gfx::Rect work_area(bounds); |
| 114 // Offset the height slightly to give a different work area. -2 is arbitrary, | 114 // Offset the height slightly to give a different work area. -2 is arbitrary, |
| 115 // it could be anything. | 115 // it could be anything. |
| 116 work_area.set_height(std::max(0, work_area.height() - 2)); | 116 work_area.set_height(std::max(0, work_area.height() - 2)); |
| 117 roots[0]->display_.set_work_area(work_area); | 117 roots[0]->display_.set_work_area(work_area); |
| 118 roots[0]->root()->SetBounds(gfx::Rect(bounds.size())); | 118 roots[0]->root()->SetBounds(gfx::Rect(bounds.size())); |
| 119 test_helper_->screen()->display_list()->UpdateDisplay( | 119 test_helper_->screen()->display_list()->UpdateDisplay( |
| 120 roots[0]->display(), views::DisplayList::Type::PRIMARY); | 120 roots[0]->display(), display::DisplayList::Type::PRIMARY); |
| 121 } | 121 } |
| 122 | 122 |
| 123 ui::Window* WmTestBase::GetPrimaryRootWindow() { | 123 ui::Window* WmTestBase::GetPrimaryRootWindow() { |
| 124 std::vector<RootWindowController*> roots = | 124 std::vector<RootWindowController*> roots = |
| 125 WmTestBase::GetRootsOrderedByDisplayId(); | 125 WmTestBase::GetRootsOrderedByDisplayId(); |
| 126 DCHECK(!roots.empty()); | 126 DCHECK(!roots.empty()); |
| 127 return roots[0]->root(); | 127 return roots[0]->root(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 ui::Window* WmTestBase::GetSecondaryRootWindow() { | 130 ui::Window* WmTestBase::GetSecondaryRootWindow() { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 ->window_manager() | 216 ->window_manager() |
| 217 ->GetRootWindowControllers(); | 217 ->GetRootWindowControllers(); |
| 218 std::vector<RootWindowController*> ordered_roots; | 218 std::vector<RootWindowController*> ordered_roots; |
| 219 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); | 219 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); |
| 220 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); | 220 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); |
| 221 return ordered_roots; | 221 return ordered_roots; |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace mus | 224 } // namespace mus |
| 225 } // namespace ash | 225 } // namespace ash |
| OLD | NEW |