| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/window_server.h" | 5 #include "services/ui/ws/window_server.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 const ServerWindow* window) const { | 227 const ServerWindow* window) const { |
| 228 if (!window) | 228 if (!window) |
| 229 return nullptr; | 229 return nullptr; |
| 230 for (auto& pair : tree_map_) { | 230 for (auto& pair : tree_map_) { |
| 231 if (pair.second->HasRoot(window)) | 231 if (pair.second->HasRoot(window)) |
| 232 return pair.second.get(); | 232 return pair.second.get(); |
| 233 } | 233 } |
| 234 return nullptr; | 234 return nullptr; |
| 235 } | 235 } |
| 236 | 236 |
| 237 void WindowServer::OnFirstWindowManagerWindowTreeFactoryReady() { | |
| 238 if (display_manager_->has_active_or_pending_displays()) | |
| 239 return; | |
| 240 | |
| 241 // We've been supplied a WindowManagerFactory and no displays have been | |
| 242 // created yet. Treat this as a signal to create a Display. | |
| 243 // TODO(sky): we need a better way to determine this, most likely a switch. | |
| 244 delegate_->CreateDefaultDisplays(); | |
| 245 } | |
| 246 | |
| 247 UserActivityMonitor* WindowServer::GetUserActivityMonitorForUser( | 237 UserActivityMonitor* WindowServer::GetUserActivityMonitorForUser( |
| 248 const UserId& user_id) { | 238 const UserId& user_id) { |
| 249 DCHECK_GT(activity_monitor_map_.count(user_id), 0u); | 239 DCHECK_GT(activity_monitor_map_.count(user_id), 0u); |
| 250 return activity_monitor_map_[user_id].get(); | 240 return activity_monitor_map_[user_id].get(); |
| 251 } | 241 } |
| 252 | 242 |
| 253 bool WindowServer::SetFocusedWindow(ServerWindow* window) { | 243 bool WindowServer::SetFocusedWindow(ServerWindow* window) { |
| 254 // TODO(sky): this should fail if there is modal dialog active and |window| | 244 // TODO(sky): this should fail if there is modal dialog active and |window| |
| 255 // is outside that. | 245 // is outside that. |
| 256 ServerWindow* currently_focused = GetFocusedWindow(); | 246 ServerWindow* currently_focused = GetFocusedWindow(); |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 void WindowServer::OnUserIdAdded(const UserId& id) { | 796 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 807 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 797 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 808 } | 798 } |
| 809 | 799 |
| 810 void WindowServer::OnUserIdRemoved(const UserId& id) { | 800 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 811 activity_monitor_map_.erase(id); | 801 activity_monitor_map_.erase(id); |
| 812 } | 802 } |
| 813 | 803 |
| 814 } // namespace ws | 804 } // namespace ws |
| 815 } // namespace ui | 805 } // namespace ui |
| OLD | NEW |