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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 const std::set<Display*>& displays = display_manager()->displays(); | 797 const std::set<Display*>& displays = display_manager()->displays(); |
798 for (auto* display : displays) | 798 for (auto* display : displays) |
799 display->platform_display()->OnGpuChannelEstablished(gpu_channel_); | 799 display->platform_display()->OnGpuChannelEstablished(gpu_channel_); |
800 } | 800 } |
801 | 801 |
802 void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id, | 802 void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id, |
803 const gfx::Size& frame_size, | 803 const gfx::Size& frame_size, |
804 float device_scale_factor) { | 804 float device_scale_factor) { |
805 WindowId window_id( | 805 WindowId window_id( |
806 WindowIdFromTransportId(surface_id.frame_sink_id().client_id())); | 806 WindowIdFromTransportId(surface_id.frame_sink_id().client_id())); |
807 mojom::SurfaceType surface_type( | 807 mojom::CompositorFrameSinkType surface_type( |
808 static_cast<mojom::SurfaceType>(surface_id.frame_sink_id().sink_id())); | 808 static_cast<mojom::CompositorFrameSinkType>( |
| 809 surface_id.frame_sink_id().sink_id())); |
809 // We only care about propagating default surface IDs. | 810 // We only care about propagating default surface IDs. |
810 // TODO(fsamuel, sadrul): we should get rid of surface types. | 811 // TODO(fsamuel, sadrul): we should get rid of surface types. |
811 if (surface_type != mojom::SurfaceType::DEFAULT) | 812 if (surface_type != mojom::CompositorFrameSinkType::DEFAULT) |
812 return; | 813 return; |
813 ServerWindow* window = GetWindow(window_id); | 814 ServerWindow* window = GetWindow(window_id); |
814 // If the window doesn't have a parent then we have nothing to propagate. | 815 // If the window doesn't have a parent then we have nothing to propagate. |
815 if (!window || !window->parent()) | 816 if (!window || !window->parent()) |
816 return; | 817 return; |
817 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); | 818 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); |
818 if (window_tree) { | 819 if (window_tree) { |
819 window_tree->ProcessWindowSurfaceChanged(window, surface_id, frame_size, | 820 window_tree->ProcessWindowSurfaceChanged(window, surface_id, frame_size, |
820 device_scale_factor); | 821 device_scale_factor); |
821 } | 822 } |
(...skipping 13 matching lines...) Expand all Loading... |
835 void WindowServer::OnUserIdAdded(const UserId& id) { | 836 void WindowServer::OnUserIdAdded(const UserId& id) { |
836 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 837 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
837 } | 838 } |
838 | 839 |
839 void WindowServer::OnUserIdRemoved(const UserId& id) { | 840 void WindowServer::OnUserIdRemoved(const UserId& id) { |
840 activity_monitor_map_.erase(id); | 841 activity_monitor_map_.erase(id); |
841 } | 842 } |
842 | 843 |
843 } // namespace ws | 844 } // namespace ws |
844 } // namespace ui | 845 } // namespace ui |
OLD | NEW |