| 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/display/window_tree_host_manager.h" | 5 #include "ash/display/window_tree_host_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 window_tree_hosts_[old_primary_display.id()] = non_primary_host; | 438 window_tree_hosts_[old_primary_display.id()] = non_primary_host; |
| 439 GetRootWindowSettings(GetWindow(non_primary_host))->display_id = | 439 GetRootWindowSettings(GetWindow(non_primary_host))->display_id = |
| 440 old_primary_display.id(); | 440 old_primary_display.id(); |
| 441 | 441 |
| 442 const DisplayLayout& layout = GetDisplayManager()->GetCurrentDisplayLayout(); | 442 const DisplayLayout& layout = GetDisplayManager()->GetCurrentDisplayLayout(); |
| 443 // The requested primary id can be same as one in the stored layout | 443 // The requested primary id can be same as one in the stored layout |
| 444 // when the primary id is set after new displays are connected. | 444 // when the primary id is set after new displays are connected. |
| 445 // Only update the layout if it is requested to swap primary display. | 445 // Only update the layout if it is requested to swap primary display. |
| 446 if (layout.primary_id != new_primary_display.id()) { | 446 if (layout.primary_id != new_primary_display.id()) { |
| 447 scoped_ptr<DisplayLayout> swapped_layout(layout.Copy()); | 447 scoped_ptr<DisplayLayout> swapped_layout(layout.Copy()); |
| 448 swapped_layout->placement_list[0]->Swap(); | 448 swapped_layout->placement_list[0].Swap(); |
| 449 swapped_layout->primary_id = new_primary_display.id(); | 449 swapped_layout->primary_id = new_primary_display.id(); |
| 450 DisplayIdList list = display_manager->GetCurrentDisplayIdList(); | 450 DisplayIdList list = display_manager->GetCurrentDisplayIdList(); |
| 451 GetDisplayManager()->layout_store()->RegisterLayoutForDisplayIdList( | 451 GetDisplayManager()->layout_store()->RegisterLayoutForDisplayIdList( |
| 452 list, std::move(swapped_layout)); | 452 list, std::move(swapped_layout)); |
| 453 } | 453 } |
| 454 | 454 |
| 455 primary_display_id = new_primary_display.id(); | 455 primary_display_id = new_primary_display.id(); |
| 456 | 456 |
| 457 UpdateWorkAreaOfDisplayNearestWindow(GetWindow(primary_host), | 457 UpdateWorkAreaOfDisplayNearestWindow(GetWindow(primary_host), |
| 458 old_primary_display.GetWorkAreaInsets()); | 458 old_primary_display.GetWorkAreaInsets()); |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 SetDisplayPropertiesOnHost(ash_host, display); | 829 SetDisplayPropertiesOnHost(ash_host, display); |
| 830 | 830 |
| 831 #if defined(OS_CHROMEOS) | 831 #if defined(OS_CHROMEOS) |
| 832 if (switches::ConstrainPointerToRoot()) | 832 if (switches::ConstrainPointerToRoot()) |
| 833 ash_host->ConfineCursorToRootWindow(); | 833 ash_host->ConfineCursorToRootWindow(); |
| 834 #endif | 834 #endif |
| 835 return ash_host; | 835 return ash_host; |
| 836 } | 836 } |
| 837 | 837 |
| 838 } // namespace ash | 838 } // namespace ash |
| OLD | NEW |