| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 | 291 |
| 292 uint32_t WindowServer::GenerateWindowManagerChangeId( | 292 uint32_t WindowServer::GenerateWindowManagerChangeId( |
| 293 WindowTree* source, | 293 WindowTree* source, |
| 294 uint32_t client_change_id) { | 294 uint32_t client_change_id) { |
| 295 const uint32_t wm_change_id = next_wm_change_id_++; | 295 const uint32_t wm_change_id = next_wm_change_id_++; |
| 296 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; | 296 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; |
| 297 return wm_change_id; | 297 return wm_change_id; |
| 298 } | 298 } |
| 299 | 299 |
| 300 void WindowServer::WindowManagerSetBoundsResponse( |
| 301 uint32_t window_manager_change_id, |
| 302 const gfx::Rect& bounds, |
| 303 const cc::LocalSurfaceId& local_surface_id) { |
| 304 auto iter = in_flight_wm_change_map_.find(window_manager_change_id); |
| 305 if (iter == in_flight_wm_change_map_.end()) |
| 306 return; |
| 307 |
| 308 InFlightWindowManagerChange change(iter->second); |
| 309 WindowTree* tree = GetTreeWithId(change.client_id); |
| 310 tree->OnSetWindowBoundsResponse(change.client_change_id, bounds, |
| 311 local_surface_id); |
| 312 } |
| 313 |
| 300 void WindowServer::WindowManagerChangeCompleted( | 314 void WindowServer::WindowManagerChangeCompleted( |
| 301 uint32_t window_manager_change_id, | 315 uint32_t window_manager_change_id, |
| 302 bool success) { | 316 bool success) { |
| 303 InFlightWindowManagerChange change; | 317 InFlightWindowManagerChange change; |
| 304 if (!GetAndClearInFlightWindowManagerChange(window_manager_change_id, | 318 if (!GetAndClearInFlightWindowManagerChange(window_manager_change_id, |
| 305 &change)) { | 319 &change)) { |
| 306 return; | 320 return; |
| 307 } | 321 } |
| 308 | 322 |
| 309 WindowTree* tree = GetTreeWithId(change.client_id); | 323 WindowTree* tree = GetTreeWithId(change.client_id); |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 void WindowServer::OnUserIdAdded(const UserId& id) { | 870 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 857 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 871 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 858 } | 872 } |
| 859 | 873 |
| 860 void WindowServer::OnUserIdRemoved(const UserId& id) { | 874 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 861 activity_monitor_map_.erase(id); | 875 activity_monitor_map_.erase(id); |
| 862 } | 876 } |
| 863 | 877 |
| 864 } // namespace ws | 878 } // namespace ws |
| 865 } // namespace ui | 879 } // namespace ui |
| OLD | NEW |