| 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 <memory> | 10 #include <memory> |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 DCHECK(controller); | 674 DCHECK(controller); |
| 675 controller->MoveWindowsTo(GetPrimaryRootWindow()); | 675 controller->MoveWindowsTo(GetPrimaryRootWindow()); |
| 676 // Delete most of root window related objects, but don't delete | 676 // Delete most of root window related objects, but don't delete |
| 677 // root window itself yet because the stack may be using it. | 677 // root window itself yet because the stack may be using it. |
| 678 controller->Shutdown(); | 678 controller->Shutdown(); |
| 679 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, controller); | 679 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, controller); |
| 680 } | 680 } |
| 681 | 681 |
| 682 void WindowTreeHostManager::OnDisplayRemoved(const display::Display& display) { | 682 void WindowTreeHostManager::OnDisplayRemoved(const display::Display& display) { |
| 683 AshWindowTreeHost* host_to_delete = window_tree_hosts_[display.id()]; | 683 AshWindowTreeHost* host_to_delete = window_tree_hosts_[display.id()]; |
| 684 CHECK(host_to_delete) << display.ToString(); | 684 CHECK(host_to_delete); |
| 685 | 685 |
| 686 // When the primary root window's display is removed, move the primary | 686 // When the primary root window's display is removed, move the primary |
| 687 // root to the other display. | 687 // root to the other display. |
| 688 if (primary_display_id == display.id()) { | 688 if (primary_display_id == display.id()) { |
| 689 // Temporarily store the primary root window in | 689 // Temporarily store the primary root window in |
| 690 // |primary_root_window_for_replace_| when replacing the display. | 690 // |primary_root_window_for_replace_| when replacing the display. |
| 691 if (window_tree_hosts_.size() == 1) { | 691 if (window_tree_hosts_.size() == 1) { |
| 692 primary_display_id = display::kInvalidDisplayId; | 692 primary_display_id = display::kInvalidDisplayId; |
| 693 primary_tree_host_for_replace_ = host_to_delete; | 693 primary_tree_host_for_replace_ = host_to_delete; |
| 694 // Display for root window will be deleted when the Primary RootWindow | 694 // Display for root window will be deleted when the Primary RootWindow |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 SetDisplayPropertiesOnHost(ash_host, display); | 889 SetDisplayPropertiesOnHost(ash_host, display); |
| 890 | 890 |
| 891 #if defined(OS_CHROMEOS) | 891 #if defined(OS_CHROMEOS) |
| 892 if (switches::ConstrainPointerToRoot()) | 892 if (switches::ConstrainPointerToRoot()) |
| 893 ash_host->ConfineCursorToRootWindow(); | 893 ash_host->ConfineCursorToRootWindow(); |
| 894 #endif | 894 #endif |
| 895 return ash_host; | 895 return ash_host; |
| 896 } | 896 } |
| 897 | 897 |
| 898 } // namespace ash | 898 } // namespace ash |
| OLD | NEW |