Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: services/ui/ws/display_manager.cc

Issue 2297743002: Process DisplaySnapshots in PlatformScreen. (Closed)
Patch Set: Fix test. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698