OLD | NEW |
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 void DisplayManager::OnDisplayAdded(int64_t id, | 174 void DisplayManager::OnDisplayAdded(int64_t id, |
175 const display::ViewportMetrics& metrics) { | 175 const display::ViewportMetrics& metrics) { |
176 TRACE_EVENT1("mus-ws", "OnDisplayAdded", "id", id); | 176 TRACE_EVENT1("mus-ws", "OnDisplayAdded", "id", id); |
177 PlatformDisplayInitParams params; | 177 PlatformDisplayInitParams params; |
178 params.display_id = id; | 178 params.display_id = id; |
179 params.metrics = metrics; | 179 params.metrics = metrics; |
180 | 180 |
181 ws::Display* display = new ws::Display(window_server_); | 181 ws::Display* display = new ws::Display(window_server_); |
182 display->Init(params, nullptr); | 182 display->Init(params, nullptr); |
183 | |
184 window_server_->delegate()->UpdateTouchTransforms(); | |
185 } | 183 } |
186 | 184 |
187 void DisplayManager::OnDisplayRemoved(int64_t id) { | 185 void DisplayManager::OnDisplayRemoved(int64_t id) { |
188 TRACE_EVENT1("mus-ws", "OnDisplayRemoved", "id", id); | 186 TRACE_EVENT1("mus-ws", "OnDisplayRemoved", "id", id); |
189 Display* display = GetDisplayById(id); | 187 Display* display = GetDisplayById(id); |
190 if (display) | 188 if (display) |
191 DestroyDisplay(display); | 189 DestroyDisplay(display); |
192 } | 190 } |
193 | 191 |
194 void DisplayManager::OnDisplayModified( | 192 void DisplayManager::OnDisplayModified( |
(...skipping 24 matching lines...) Expand all Loading... |
219 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) { | 217 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) { |
220 // TODO(kylechar): Send IPCs to WM clients first. | 218 // TODO(kylechar): Send IPCs to WM clients first. |
221 | 219 |
222 // Send IPCs to any DisplayManagerObservers. | 220 // Send IPCs to any DisplayManagerObservers. |
223 for (const auto& pair : user_display_managers_) | 221 for (const auto& pair : user_display_managers_) |
224 pair.second->OnPrimaryDisplayChanged(primary_display_id); | 222 pair.second->OnPrimaryDisplayChanged(primary_display_id); |
225 } | 223 } |
226 | 224 |
227 } // namespace ws | 225 } // namespace ws |
228 } // namespace ui | 226 } // namespace ui |
OLD | NEW |