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