| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/window_server.h" | 5 #include "services/ui/ws/window_server.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 next_wm_change_id_(0), | 54 next_wm_change_id_(0), |
| 55 gpu_proxy_(new GpuServiceProxy(this)), | 55 gpu_proxy_(new GpuServiceProxy(this)), |
| 56 window_manager_window_tree_factory_set_(this, &user_id_tracker_) { | 56 window_manager_window_tree_factory_set_(this, &user_id_tracker_) { |
| 57 user_id_tracker_.AddObserver(this); | 57 user_id_tracker_.AddObserver(this); |
| 58 OnUserIdAdded(user_id_tracker_.active_id()); | 58 OnUserIdAdded(user_id_tracker_.active_id()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 WindowServer::~WindowServer() { | 61 WindowServer::~WindowServer() { |
| 62 in_destructor_ = true; | 62 in_destructor_ = true; |
| 63 | 63 |
| 64 for (auto& pair : tree_map_) |
| 65 pair.second->PrepareForWindowServerShutdown(); |
| 66 |
| 64 // Destroys the window trees results in querying for the display. Tear down | 67 // Destroys the window trees results in querying for the display. Tear down |
| 65 // the displays first so that the trees are notified of the display going | 68 // the displays first so that the trees are notified of the display going |
| 66 // away while the display is still valid. | 69 // away while the display is still valid. |
| 67 display_manager_->DestroyAllDisplays(); | 70 display_manager_->DestroyAllDisplays(); |
| 68 | 71 |
| 69 while (!tree_map_.empty()) | 72 while (!tree_map_.empty()) |
| 70 DestroyTree(tree_map_.begin()->second.get()); | 73 DestroyTree(tree_map_.begin()->second.get()); |
| 71 | 74 |
| 72 display_manager_.reset(); | 75 display_manager_.reset(); |
| 73 } | 76 } |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 void WindowServer::OnUserIdAdded(const UserId& id) { | 833 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 831 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 834 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 832 } | 835 } |
| 833 | 836 |
| 834 void WindowServer::OnUserIdRemoved(const UserId& id) { | 837 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 835 activity_monitor_map_.erase(id); | 838 activity_monitor_map_.erase(id); |
| 836 } | 839 } |
| 837 | 840 |
| 838 } // namespace ws | 841 } // namespace ws |
| 839 } // namespace ui | 842 } // namespace ui |
| OLD | NEW |