Chromium Code Reviews| Index: services/ui/ws/display_manager.cc |
| diff --git a/services/ui/ws/display_manager.cc b/services/ui/ws/display_manager.cc |
| index 70b3b58fec5e6884927d07160546737de4ba5808..1e35b74e4fa9de6a37f6485fb6743999992968d0 100644 |
| --- a/services/ui/ws/display_manager.cc |
| +++ b/services/ui/ws/display_manager.cc |
| @@ -104,6 +104,14 @@ const Display* DisplayManager::GetDisplayContaining( |
| return nullptr; |
| } |
| +Display* DisplayManager::GetDisplayById(int64_t display_id) { |
|
rjkroege
2016/08/30 18:41:59
So: this display_id is a an id of a ui::Display ri
kylechar
2016/08/31 15:58:01
We're using the same id in all places.
|
| + for (Display* display : displays_) { |
| + if (display->GetId() == display_id) |
| + return display; |
| + } |
| + return nullptr; |
| +} |
| + |
| const WindowManagerDisplayRoot* DisplayManager::GetWindowManagerDisplayRoot( |
| const ServerWindow* window) const { |
| const ServerWindow* last = window; |
| @@ -175,8 +183,10 @@ void DisplayManager::OnDisplayAdded(display::PlatformScreen* platform_screen, |
| } |
| void DisplayManager::OnDisplayRemoved(int64_t id) { |
| - // TODO(kylechar): Implement. |
| - NOTREACHED(); |
| + Display* display = GetDisplayById(id); |
|
rjkroege
2016/08/30 18:41:59
The PlatformDisplay should be the delegate and get
kylechar
2016/08/31 15:58:01
I'm not sure I agree/understand. Let's discuss at
kylechar
2016/08/31 16:07:35
Should have changed that comment. As per the discu
|
| + if (display) |
| + window_server_->display_manager()->DestroyDisplay(display); |
| + // TODO(kylechar): What if the display is still pending? |
| } |
| void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) { |