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 "services/ui/ws/display_manager.h" | 5 #include "services/ui/ws/display_manager.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "services/ui/ws/display.h" | 8 #include "services/ui/ws/display.h" |
9 #include "services/ui/ws/display_manager_delegate.h" | 9 #include "services/ui/ws/display_manager_delegate.h" |
10 #include "services/ui/ws/event_dispatcher.h" | 10 #include "services/ui/ws/event_dispatcher.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 for (const auto& pair : user_display_managers_) | 54 for (const auto& pair : user_display_managers_) |
55 pair.second->OnWillDestroyDisplay(display); | 55 pair.second->OnWillDestroyDisplay(display); |
56 | 56 |
57 DCHECK(displays_.count(display)); | 57 DCHECK(displays_.count(display)); |
58 displays_.erase(display); | 58 displays_.erase(display); |
59 } | 59 } |
60 delete display; | 60 delete display; |
61 | 61 |
62 // If we have no more roots left, let the app know so it can terminate. | 62 // If we have no more roots left, let the app know so it can terminate. |
63 // TODO(sky): move to delegate/observer. | 63 // TODO(sky): move to delegate/observer. |
64 if (!displays_.size() && !pending_displays_.size()) | 64 if (displays_.empty() && pending_displays_.empty()) |
65 delegate_->OnNoMoreDisplays(); | 65 delegate_->OnNoMoreDisplays(); |
66 } | 66 } |
67 | 67 |
68 void DisplayManager::DestroyAllDisplays() { | 68 void DisplayManager::DestroyAllDisplays() { |
69 while (!pending_displays_.empty()) | 69 while (!pending_displays_.empty()) |
70 DestroyDisplay(*pending_displays_.begin()); | 70 DestroyDisplay(*pending_displays_.begin()); |
71 DCHECK(pending_displays_.empty()); | 71 DCHECK(pending_displays_.empty()); |
72 | 72 |
73 while (!displays_.empty()) | 73 while (!displays_.empty()) |
74 DestroyDisplay(*displays_.begin()); | 74 DestroyDisplay(*displays_.begin()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 | 159 |
160 WindowManagerState* current_window_manager_state = | 160 WindowManagerState* current_window_manager_state = |
161 delegate_->GetWindowManagerStateForUser(active_id); | 161 delegate_->GetWindowManagerStateForUser(active_id); |
162 if (current_window_manager_state) | 162 if (current_window_manager_state) |
163 current_window_manager_state->Activate(mouse_location_on_screen); | 163 current_window_manager_state->Activate(mouse_location_on_screen); |
164 } | 164 } |
165 | 165 |
166 } // namespace ws | 166 } // namespace ws |
167 } // namespace ui | 167 } // namespace ui |
OLD | NEW |