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

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

Issue 2297743002: Process DisplaySnapshots in PlatformScreen. (Closed)
Patch Set: Add comment. Created 4 years, 3 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
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | testing/buildbot/chromium.chromiumos.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display_manager.cc
diff --git a/services/ui/ws/display_manager.cc b/services/ui/ws/display_manager.cc
index 56920038047fc651ab42cc6335c6c57fdcd13a40..cfcb31cf86cbce856523605680bd0d282f98b154 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) {
+ 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);
+ if (display)
+ DestroyDisplay(display);
+ // TODO(kylechar): What if the display is still pending?
}
void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) {
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | testing/buildbot/chromium.chromiumos.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698