Chromium Code Reviews| 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 849 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated( | 849 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated( |
| 850 surface_info); | 850 surface_info); |
| 851 display->root_window() | 851 display->root_window() |
| 852 ->GetOrCreateCompositorFrameSinkManager() | 852 ->GetOrCreateCompositorFrameSinkManager() |
| 853 ->ClaimTemporaryReference(surface_info.id()); | 853 ->ClaimTemporaryReference(surface_info.id()); |
| 854 return; | 854 return; |
| 855 } | 855 } |
| 856 | 856 |
| 857 HandleTemporaryReferenceForNewSurface(surface_info.id(), window); | 857 HandleTemporaryReferenceForNewSurface(surface_info.id(), window); |
| 858 | 858 |
| 859 if (!window->parent()) | 859 ClientSpecificId window_tree_id = window->id().client_id; |
| 860 return; | 860 // If the window has a parent, we should use the parent's tree, because the |
| 861 // window could be an embedded window, and the window will be in both | |
| 862 // the embedder's tree and embeddee's tree, in this case we shold notify | |
| 863 // the embedder's tree about the surface change. | |
| 864 if (window->parent()) | |
| 865 window_tree_id = window->parent()->id().client_id; | |
|
Fady Samuel
2017/05/25 20:58:03
So we agreed to undo this change?
Peng
2017/05/25 23:10:39
The origin code will not send the new surface id t
Peng
2017/05/26 13:58:25
I just realized, we should never use the parent wi
| |
| 861 | 866 |
| 862 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); | 867 WindowTree* window_tree = GetTreeWithId(window_tree_id); |
| 863 if (window_tree) | 868 if (window_tree) |
| 864 window_tree->ProcessWindowSurfaceChanged(window, surface_info); | 869 window_tree->ProcessWindowSurfaceChanged(window, surface_info); |
| 865 } | 870 } |
| 866 | 871 |
| 867 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, | 872 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, |
| 868 const UserId& active_id) { | 873 const UserId& active_id) { |
| 869 } | 874 } |
| 870 | 875 |
| 871 void WindowServer::OnUserIdAdded(const UserId& id) { | 876 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 872 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 877 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 873 } | 878 } |
| 874 | 879 |
| 875 void WindowServer::OnUserIdRemoved(const UserId& id) { | 880 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 876 activity_monitor_map_.erase(id); | 881 activity_monitor_map_.erase(id); |
| 877 } | 882 } |
| 878 | 883 |
| 879 } // namespace ws | 884 } // namespace ws |
| 880 } // namespace ui | 885 } // namespace ui |
| OLD | NEW |