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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 base::MakeUnique<CursorLocationManager>(); | 70 base::MakeUnique<CursorLocationManager>(); |
71 } | 71 } |
72 return cursor_location_managers_[user_id].get(); | 72 return cursor_location_managers_[user_id].get(); |
73 } | 73 } |
74 | 74 |
75 void DisplayManager::AddDisplay(Display* display) { | 75 void DisplayManager::AddDisplay(Display* display) { |
76 DCHECK_EQ(0u, pending_displays_.count(display)); | 76 DCHECK_EQ(0u, pending_displays_.count(display)); |
77 pending_displays_.insert(display); | 77 pending_displays_.insert(display); |
78 } | 78 } |
79 | 79 |
| 80 void DisplayManager::AddDisplayForWindowManager( |
| 81 const display::Display& display, |
| 82 const display::ViewportMetrics& metrics) { |
| 83 OnDisplayAdded(display, metrics); |
| 84 } |
| 85 |
80 void DisplayManager::DestroyDisplay(Display* display) { | 86 void DisplayManager::DestroyDisplay(Display* display) { |
81 if (pending_displays_.count(display)) { | 87 if (pending_displays_.count(display)) { |
82 pending_displays_.erase(display); | 88 pending_displays_.erase(display); |
83 } else { | 89 } else { |
84 for (const auto& pair : user_display_managers_) | 90 for (const auto& pair : user_display_managers_) |
85 pair.second->OnWillDestroyDisplay(display->GetId()); | 91 pair.second->OnWillDestroyDisplay(display->GetId()); |
86 | 92 |
87 DCHECK(displays_.count(display)); | 93 DCHECK(displays_.count(display)); |
88 displays_.erase(display); | 94 displays_.erase(display); |
89 window_server_->OnDisplayDestroyed(display); | 95 window_server_->OnDisplayDestroyed(display); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 DVLOG(3) << "OnPrimaryDisplayChanged: " << primary_display_id; | 255 DVLOG(3) << "OnPrimaryDisplayChanged: " << primary_display_id; |
250 // TODO(kylechar): Send IPCs to WM clients first. | 256 // TODO(kylechar): Send IPCs to WM clients first. |
251 | 257 |
252 // Send IPCs to any DisplayManagerObservers. | 258 // Send IPCs to any DisplayManagerObservers. |
253 for (const auto& pair : user_display_managers_) | 259 for (const auto& pair : user_display_managers_) |
254 pair.second->OnPrimaryDisplayChanged(primary_display_id); | 260 pair.second->OnPrimaryDisplayChanged(primary_display_id); |
255 } | 261 } |
256 | 262 |
257 } // namespace ws | 263 } // namespace ws |
258 } // namespace ui | 264 } // namespace ui |
OLD | NEW |