| 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/test/display_manager_test_api.h" | 5 #include "ash/test/display_manager_test_api.h" |
| 6 | 6 |
| 7 #include <cstdarg> | 7 #include <cstdarg> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return display_manager->SetDisplayMode(display_id, mode); | 164 return display_manager->SetDisplayMode(display_id, mode); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void SwapPrimaryDisplay() { | 167 void SwapPrimaryDisplay() { |
| 168 if (gfx::Screen::GetScreen()->GetNumDisplays() <= 1) | 168 if (gfx::Screen::GetScreen()->GetNumDisplays() <= 1) |
| 169 return; | 169 return; |
| 170 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId( | 170 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId( |
| 171 ScreenUtil::GetSecondaryDisplay().id()); | 171 ScreenUtil::GetSecondaryDisplay().id()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 scoped_ptr<display::DisplayLayout> CreateDisplayLayout( | 174 std::unique_ptr<display::DisplayLayout> CreateDisplayLayout( |
| 175 display::DisplayPlacement::Position position, | 175 display::DisplayPlacement::Position position, |
| 176 int offset) { | 176 int offset) { |
| 177 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 177 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 178 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); | 178 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); |
| 179 | 179 |
| 180 display::DisplayLayoutBuilder builder( | 180 display::DisplayLayoutBuilder builder( |
| 181 gfx::Screen::GetScreen()->GetPrimaryDisplay().id()); | 181 gfx::Screen::GetScreen()->GetPrimaryDisplay().id()); |
| 182 builder.SetSecondaryPlacement(ScreenUtil::GetSecondaryDisplay().id(), | 182 builder.SetSecondaryPlacement(ScreenUtil::GetSecondaryDisplay().id(), |
| 183 position, offset); | 183 position, offset); |
| 184 return builder.Build(); | 184 return builder.Build(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 199 for (size_t i = 0; i < count; i++) { | 199 for (size_t i = 0; i < count; i++) { |
| 200 int64_t id = va_arg(args, int64_t); | 200 int64_t id = va_arg(args, int64_t); |
| 201 list.push_back(id); | 201 list.push_back(id); |
| 202 } | 202 } |
| 203 SortDisplayIdList(&list); | 203 SortDisplayIdList(&list); |
| 204 return list; | 204 return list; |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace test | 207 } // namespace test |
| 208 } // namespace ash | 208 } // namespace ash |
| OLD | NEW |