| 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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 frame_sink_manager_->DropTemporaryReference(surface_info.id()); | 819 frame_sink_manager_->DropTemporaryReference(surface_info.id()); |
| 820 return; | 820 return; |
| 821 } | 821 } |
| 822 | 822 |
| 823 // This is only used for testing to observe that a window has a | 823 // This is only used for testing to observe that a window has a |
| 824 // CompositorFrame. | 824 // CompositorFrame. |
| 825 if (!window_paint_callback_.is_null()) | 825 if (!window_paint_callback_.is_null()) |
| 826 window_paint_callback_.Run(window); | 826 window_paint_callback_.Run(window); |
| 827 | 827 |
| 828 auto* display = display_manager_->GetDisplayContaining(window); | 828 auto* display = display_manager_->GetDisplayContaining(window); |
| 829 if (display && window == display->GetActiveRootWindow()) { | 829 const bool match1 = (display && window == display->GetActiveRootWindow()); |
| 830 const bool match2 = |
| 831 (display && window->parent() == display->GetActiveRootWindow()); |
| 832 if (match1 || match2) { |
| 830 // A new surface for a WindowManager root has been created. This is a | 833 // A new surface for a WindowManager root has been created. This is a |
| 831 // special case because ServerWindows created by the WindowServer are not | 834 // special case because ServerWindows created by the WindowServer are not |
| 832 // part of a WindowTree. Send the SurfaceId directly to FrameGenerator and | 835 // part of a WindowTree. Send the SurfaceId directly to FrameGenerator and |
| 833 // claim the temporary reference for the display root. | 836 // claim the temporary reference for the display root. |
| 834 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated( | 837 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated( |
| 835 surface_info); | 838 surface_info); |
| 836 display->root_window() | 839 display->root_window() |
| 837 ->GetOrCreateCompositorFrameSinkManager() | 840 ->GetOrCreateCompositorFrameSinkManager() |
| 838 ->ClaimTemporaryReference(surface_info.id()); | 841 ->ClaimTemporaryReference(surface_info.id()); |
| 839 return; | 842 return; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 856 void WindowServer::OnUserIdAdded(const UserId& id) { | 859 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 857 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 860 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 858 } | 861 } |
| 859 | 862 |
| 860 void WindowServer::OnUserIdRemoved(const UserId& id) { | 863 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 861 activity_monitor_map_.erase(id); | 864 activity_monitor_map_.erase(id); |
| 862 } | 865 } |
| 863 | 866 |
| 864 } // namespace ws | 867 } // namespace ws |
| 865 } // namespace ui | 868 } // namespace ui |
| OLD | NEW |