| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 WindowManagerState* WindowServer::GetWindowManagerStateForUser( | 525 WindowManagerState* WindowServer::GetWindowManagerStateForUser( |
| 526 const UserId& user_id) { | 526 const UserId& user_id) { |
| 527 return window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( | 527 return window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( |
| 528 user_id); | 528 user_id); |
| 529 } | 529 } |
| 530 | 530 |
| 531 cc::mojom::DisplayCompositor* WindowServer::GetDisplayCompositor() { | 531 cc::mojom::DisplayCompositor* WindowServer::GetDisplayCompositor() { |
| 532 return display_compositor_.get(); | 532 return display_compositor_.get(); |
| 533 } | 533 } |
| 534 | 534 |
| 535 const cc::SurfaceId& WindowServer::GetRootSurfaceId() const { | |
| 536 DCHECK(root_surface_id_.local_frame_id().is_valid()); | |
| 537 return root_surface_id_; | |
| 538 } | |
| 539 | |
| 540 bool WindowServer::GetFrameDecorationsForUser( | 535 bool WindowServer::GetFrameDecorationsForUser( |
| 541 const UserId& user_id, | 536 const UserId& user_id, |
| 542 mojom::FrameDecorationValuesPtr* values) { | 537 mojom::FrameDecorationValuesPtr* values) { |
| 543 WindowManagerState* window_manager_state = | 538 WindowManagerState* window_manager_state = |
| 544 window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( | 539 window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( |
| 545 user_id); | 540 user_id); |
| 546 if (!window_manager_state) | 541 if (!window_manager_state) |
| 547 return false; | 542 return false; |
| 548 if (values && window_manager_state->got_frame_decoration_values()) | 543 if (values && window_manager_state->got_frame_decoration_values()) |
| 549 *values = window_manager_state->frame_decoration_values().Clone(); | 544 *values = window_manager_state->frame_decoration_values().Clone(); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 window_paint_callback_.Run(window); | 794 window_paint_callback_.Run(window); |
| 800 | 795 |
| 801 if (!window->parent()) | 796 if (!window->parent()) |
| 802 return; | 797 return; |
| 803 | 798 |
| 804 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); | 799 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); |
| 805 if (window_tree) | 800 if (window_tree) |
| 806 window_tree->ProcessWindowSurfaceChanged(window, surface_info); | 801 window_tree->ProcessWindowSurfaceChanged(window, surface_info); |
| 807 } | 802 } |
| 808 | 803 |
| 809 void WindowServer::OnDisplayCompositorCreated( | |
| 810 const cc::SurfaceId& root_surface_id) { | |
| 811 root_surface_id_ = root_surface_id; | |
| 812 } | |
| 813 | |
| 814 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, | 804 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, |
| 815 const UserId& active_id) { | 805 const UserId& active_id) { |
| 816 } | 806 } |
| 817 | 807 |
| 818 void WindowServer::OnUserIdAdded(const UserId& id) { | 808 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 819 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 809 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 820 } | 810 } |
| 821 | 811 |
| 822 void WindowServer::OnUserIdRemoved(const UserId& id) { | 812 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 823 activity_monitor_map_.erase(id); | 813 activity_monitor_map_.erase(id); |
| 824 } | 814 } |
| 825 | 815 |
| 826 } // namespace ws | 816 } // namespace ws |
| 827 } // namespace ui | 817 } // namespace ui |
| OLD | NEW |