| 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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "services/ui/ws/display.h" | 8 #include "services/ui/ws/display.h" |
| 9 #include "services/ui/ws/display_manager_delegate.h" | 9 #include "services/ui/ws/display_manager_delegate.h" |
| 10 #include "services/ui/ws/event_dispatcher.h" | 10 #include "services/ui/ws/event_dispatcher.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 DisplayManager::~DisplayManager() { | 30 DisplayManager::~DisplayManager() { |
| 31 user_id_tracker_->RemoveObserver(this); | 31 user_id_tracker_->RemoveObserver(this); |
| 32 DestroyAllDisplays(); | 32 DestroyAllDisplays(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 UserDisplayManager* DisplayManager::GetUserDisplayManager( | 35 UserDisplayManager* DisplayManager::GetUserDisplayManager( |
| 36 const UserId& user_id) { | 36 const UserId& user_id) { |
| 37 if (!user_display_managers_.count(user_id)) { | 37 if (!user_display_managers_.count(user_id)) { |
| 38 user_display_managers_[user_id] = | 38 user_display_managers_[user_id] = |
| 39 base::WrapUnique(new UserDisplayManager(this, delegate_, user_id)); | 39 base::MakeUnique<UserDisplayManager>(this, delegate_, user_id); |
| 40 } | 40 } |
| 41 return user_display_managers_[user_id].get(); | 41 return user_display_managers_[user_id].get(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void DisplayManager::AddDisplay(Display* display) { | 44 void DisplayManager::AddDisplay(Display* display) { |
| 45 DCHECK_EQ(0u, pending_displays_.count(display)); | 45 DCHECK_EQ(0u, pending_displays_.count(display)); |
| 46 pending_displays_.insert(display); | 46 pending_displays_.insert(display); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void DisplayManager::DestroyDisplay(Display* display) { | 49 void DisplayManager::DestroyDisplay(Display* display) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 WindowManagerState* current_window_manager_state = | 152 WindowManagerState* current_window_manager_state = |
| 153 delegate_->GetWindowManagerStateForUser(active_id); | 153 delegate_->GetWindowManagerStateForUser(active_id); |
| 154 if (current_window_manager_state) | 154 if (current_window_manager_state) |
| 155 current_window_manager_state->Activate(mouse_location_on_screen); | 155 current_window_manager_state->Activate(mouse_location_on_screen); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace ws | 158 } // namespace ws |
| 159 } // namespace ui | 159 } // namespace ui |
| OLD | NEW |