| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 WindowManagerState* WindowServer::GetWindowManagerStateForUser( | 508 WindowManagerState* WindowServer::GetWindowManagerStateForUser( |
| 509 const UserId& user_id) { | 509 const UserId& user_id) { |
| 510 return window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( | 510 return window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( |
| 511 user_id); | 511 user_id); |
| 512 } | 512 } |
| 513 | 513 |
| 514 cc::mojom::DisplayCompositor* WindowServer::GetDisplayCompositor() { | 514 cc::mojom::DisplayCompositor* WindowServer::GetDisplayCompositor() { |
| 515 return display_compositor_.get(); | 515 return display_compositor_.get(); |
| 516 } | 516 } |
| 517 | 517 |
| 518 const cc::SurfaceId& WindowServer::GetRootSurfaceId() const { |
| 519 DCHECK(!root_surface_id_.local_frame_id().nonce().is_empty()); |
| 520 return root_surface_id_; |
| 521 } |
| 522 |
| 518 bool WindowServer::GetFrameDecorationsForUser( | 523 bool WindowServer::GetFrameDecorationsForUser( |
| 519 const UserId& user_id, | 524 const UserId& user_id, |
| 520 mojom::FrameDecorationValuesPtr* values) { | 525 mojom::FrameDecorationValuesPtr* values) { |
| 521 WindowManagerState* window_manager_state = | 526 WindowManagerState* window_manager_state = |
| 522 window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( | 527 window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( |
| 523 user_id); | 528 user_id); |
| 524 if (!window_manager_state) | 529 if (!window_manager_state) |
| 525 return false; | 530 return false; |
| 526 if (values && window_manager_state->got_frame_decoration_values()) | 531 if (values && window_manager_state->got_frame_decoration_values()) |
| 527 *values = window_manager_state->frame_decoration_values().Clone(); | 532 *values = window_manager_state->frame_decoration_values().Clone(); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 !window->parent()) { | 792 !window->parent()) { |
| 788 return; | 793 return; |
| 789 } | 794 } |
| 790 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); | 795 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); |
| 791 if (window_tree) { | 796 if (window_tree) { |
| 792 window_tree->ProcessWindowSurfaceChanged(window, surface_id, frame_size, | 797 window_tree->ProcessWindowSurfaceChanged(window, surface_id, frame_size, |
| 793 device_scale_factor); | 798 device_scale_factor); |
| 794 } | 799 } |
| 795 } | 800 } |
| 796 | 801 |
| 802 void WindowServer::OnRootSurfaceId(const cc::SurfaceId& root_surface_id) { |
| 803 LOG(ERROR) << "Got root surface id " << root_surface_id; |
| 804 root_surface_id_ = root_surface_id; |
| 805 } |
| 806 |
| 797 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, | 807 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, |
| 798 const UserId& active_id) { | 808 const UserId& active_id) { |
| 799 } | 809 } |
| 800 | 810 |
| 801 void WindowServer::OnUserIdAdded(const UserId& id) { | 811 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 802 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 812 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 803 } | 813 } |
| 804 | 814 |
| 805 void WindowServer::OnUserIdRemoved(const UserId& id) { | 815 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 806 activity_monitor_map_.erase(id); | 816 activity_monitor_map_.erase(id); |
| 807 } | 817 } |
| 808 | 818 |
| 809 } // namespace ws | 819 } // namespace ws |
| 810 } // namespace ui | 820 } // namespace ui |
| OLD | NEW |