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

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

Issue 2904993003: chromeos: changes how DisplayManagerObservers are notified (Closed)
Patch Set: cleanup Created 3 years, 7 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.h ('k') | services/ui/ws/display_creation_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display.cc
diff --git a/services/ui/ws/display.cc b/services/ui/ws/display.cc
index 4625f3ecab6e9cf43be27e828eece1acfa8a43a0..a355f1905393a6a2d77b9fac748c62e416e5b361 100644
--- a/services/ui/ws/display.cc
+++ b/services/ui/ws/display.cc
@@ -190,6 +190,8 @@ void Display::RemoveWindowManagerDisplayRoot(
it != window_manager_display_root_map_.end(); ++it) {
if (it->second == display_root) {
window_manager_display_root_map_.erase(it);
+ if (window_manager_display_root_map_.empty())
+ display_manager()->DestroyDisplay(this);
return;
}
}
@@ -299,10 +301,14 @@ void Display::OnViewportMetricsChanged(
const display::ViewportMetrics& metrics) {
platform_display_->UpdateViewportMetrics(metrics);
- if (root_->bounds().size() == metrics.bounds_in_pixels.size())
+ SetBoundsInPixels(metrics.bounds_in_pixels);
+}
+
+void Display::SetBoundsInPixels(const gfx::Rect& bounds_in_pixels) {
+ if (root_->bounds().size() == bounds_in_pixels.size())
return;
- gfx::Rect new_bounds(metrics.bounds_in_pixels.size());
+ gfx::Rect new_bounds(bounds_in_pixels.size());
root_->SetBounds(new_bounds, allocator_.GenerateId());
for (auto& pair : window_manager_display_root_map_)
pair.second->root()->SetBounds(new_bounds, allocator_.GenerateId());
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/display_creation_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698