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