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

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

Issue 2829733002: mus: Changes SetDisplayRoot() to create actual display (Closed)
Patch Set: unnecessary get Created 3 years, 8 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/ws/display_manager.h ('k') | services/ui/ws/test_utils.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 base::MakeUnique<CursorLocationManager>(); 70 base::MakeUnique<CursorLocationManager>();
71 } 71 }
72 return cursor_location_managers_[user_id].get(); 72 return cursor_location_managers_[user_id].get();
73 } 73 }
74 74
75 void DisplayManager::AddDisplay(Display* display) { 75 void DisplayManager::AddDisplay(Display* display) {
76 DCHECK_EQ(0u, pending_displays_.count(display)); 76 DCHECK_EQ(0u, pending_displays_.count(display));
77 pending_displays_.insert(display); 77 pending_displays_.insert(display);
78 } 78 }
79 79
80 void DisplayManager::AddDisplayForWindowManager(
81 const display::Display& display,
82 const display::ViewportMetrics& metrics) {
83 OnDisplayAdded(display, metrics);
84 }
85
80 void DisplayManager::DestroyDisplay(Display* display) { 86 void DisplayManager::DestroyDisplay(Display* display) {
81 if (pending_displays_.count(display)) { 87 if (pending_displays_.count(display)) {
82 pending_displays_.erase(display); 88 pending_displays_.erase(display);
83 } else { 89 } else {
84 for (const auto& pair : user_display_managers_) 90 for (const auto& pair : user_display_managers_)
85 pair.second->OnWillDestroyDisplay(display->GetId()); 91 pair.second->OnWillDestroyDisplay(display->GetId());
86 92
87 DCHECK(displays_.count(display)); 93 DCHECK(displays_.count(display));
88 displays_.erase(display); 94 displays_.erase(display);
89 window_server_->OnDisplayDestroyed(display); 95 window_server_->OnDisplayDestroyed(display);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 DVLOG(3) << "OnPrimaryDisplayChanged: " << primary_display_id; 255 DVLOG(3) << "OnPrimaryDisplayChanged: " << primary_display_id;
250 // TODO(kylechar): Send IPCs to WM clients first. 256 // TODO(kylechar): Send IPCs to WM clients first.
251 257
252 // Send IPCs to any DisplayManagerObservers. 258 // Send IPCs to any DisplayManagerObservers.
253 for (const auto& pair : user_display_managers_) 259 for (const auto& pair : user_display_managers_)
254 pair.second->OnPrimaryDisplayChanged(primary_display_id); 260 pair.second->OnPrimaryDisplayChanged(primary_display_id);
255 } 261 }
256 262
257 } // namespace ws 263 } // namespace ws
258 } // namespace ui 264 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698