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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 UserDisplayManager* DisplayManager::GetUserDisplayManager( | 43 UserDisplayManager* DisplayManager::GetUserDisplayManager( |
44 const UserId& user_id) { | 44 const UserId& user_id) { |
45 if (!user_display_managers_.count(user_id)) { | 45 if (!user_display_managers_.count(user_id)) { |
46 user_display_managers_[user_id] = | 46 user_display_managers_[user_id] = |
47 base::MakeUnique<UserDisplayManager>(this, window_server_, user_id); | 47 base::MakeUnique<UserDisplayManager>(this, window_server_, user_id); |
48 } | 48 } |
49 return user_display_managers_[user_id].get(); | 49 return user_display_managers_[user_id].get(); |
50 } | 50 } |
51 | 51 |
| 52 CursorLocationManager* DisplayManager::GetCursorLocationManager( |
| 53 const UserId& user_id) { |
| 54 if (!cursor_location_managers_.count(user_id)) { |
| 55 cursor_location_managers_[user_id] = |
| 56 base::MakeUnique<CursorLocationManager>(); |
| 57 } |
| 58 return cursor_location_managers_[user_id].get(); |
| 59 } |
| 60 |
52 void DisplayManager::AddDisplay(Display* display) { | 61 void DisplayManager::AddDisplay(Display* display) { |
53 DCHECK_EQ(0u, pending_displays_.count(display)); | 62 DCHECK_EQ(0u, pending_displays_.count(display)); |
54 pending_displays_.insert(display); | 63 pending_displays_.insert(display); |
55 } | 64 } |
56 | 65 |
57 void DisplayManager::DestroyDisplay(Display* display) { | 66 void DisplayManager::DestroyDisplay(Display* display) { |
58 if (pending_displays_.count(display)) { | 67 if (pending_displays_.count(display)) { |
59 pending_displays_.erase(display); | 68 pending_displays_.erase(display); |
60 } else { | 69 } else { |
61 for (const auto& pair : user_display_managers_) | 70 for (const auto& pair : user_display_managers_) |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) { | 226 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) { |
218 // TODO(kylechar): Send IPCs to WM clients first. | 227 // TODO(kylechar): Send IPCs to WM clients first. |
219 | 228 |
220 // Send IPCs to any DisplayManagerObservers. | 229 // Send IPCs to any DisplayManagerObservers. |
221 for (const auto& pair : user_display_managers_) | 230 for (const auto& pair : user_display_managers_) |
222 pair.second->OnPrimaryDisplayChanged(primary_display_id); | 231 pair.second->OnPrimaryDisplayChanged(primary_display_id); |
223 } | 232 } |
224 | 233 |
225 } // namespace ws | 234 } // namespace ws |
226 } // namespace ui | 235 } // namespace ui |
OLD | NEW |