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

Side by Side Diff: services/ui/ws/display_manager.cc

Issue 2610783003: mus: Make sure window parenting happens in the window server. (Closed)
Patch Set: . Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « services/ui/gpu/interfaces/gpu_host.mojom ('k') | services/ui/ws/gpu_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void DisplayManager::DestroyDisplay(Display* display) { 57 void DisplayManager::DestroyDisplay(Display* display) {
58 if (pending_displays_.count(display)) { 58 if (pending_displays_.count(display)) {
59 pending_displays_.erase(display); 59 pending_displays_.erase(display);
60 } else { 60 } else {
61 for (const auto& pair : user_display_managers_) 61 for (const auto& pair : user_display_managers_)
62 pair.second->OnWillDestroyDisplay(display); 62 pair.second->OnWillDestroyDisplay(display);
63 63
64 DCHECK(displays_.count(display)); 64 DCHECK(displays_.count(display));
65 displays_.erase(display); 65 displays_.erase(display);
66 window_server_->OnDisplayDestroyed(display);
66 } 67 }
67 delete display; 68 delete display;
68 69
69 // If we have no more roots left, let the app know so it can terminate. 70 // If we have no more roots left, let the app know so it can terminate.
70 // TODO(sky): move to delegate/observer. 71 // TODO(sky): move to delegate/observer.
71 if (displays_.empty() && pending_displays_.empty()) 72 if (displays_.empty() && pending_displays_.empty())
72 window_server_->OnNoMoreDisplays(); 73 window_server_->OnNoMoreDisplays();
73 } 74 }
74 75
75 void DisplayManager::DestroyAllDisplays() { 76 void DisplayManager::DestroyAllDisplays() {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) { 219 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) {
219 // TODO(kylechar): Send IPCs to WM clients first. 220 // TODO(kylechar): Send IPCs to WM clients first.
220 221
221 // Send IPCs to any DisplayManagerObservers. 222 // Send IPCs to any DisplayManagerObservers.
222 for (const auto& pair : user_display_managers_) 223 for (const auto& pair : user_display_managers_)
223 pair.second->OnPrimaryDisplayChanged(primary_display_id); 224 pair.second->OnPrimaryDisplayChanged(primary_display_id);
224 } 225 }
225 226
226 } // namespace ws 227 } // namespace ws
227 } // namespace ui 228 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/gpu/interfaces/gpu_host.mojom ('k') | services/ui/ws/gpu_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698