Index: components/mus/ws/connection_manager.cc |
diff --git a/components/mus/ws/connection_manager.cc b/components/mus/ws/connection_manager.cc |
index 0604537ea8f770b95f898ba6955b7745546cd662..b7c22f994242c1619aad9cd86495c3f19e828cf0 100644 |
--- a/components/mus/ws/connection_manager.cc |
+++ b/components/mus/ws/connection_manager.cc |
@@ -535,6 +535,22 @@ void ConnectionManager::ScheduleSurfaceDestruction(ServerWindow* window) { |
} |
} |
+ServerWindow* ConnectionManager::FindWindowForSurface( |
+ const ServerWindow* ancestor, |
+ mojom::SurfaceType surface_type, |
+ const ClientWindowId& client_window_id) { |
+ WindowTreeImpl* window_tree = GetConnection(ancestor->id().connection_id); |
+ if (!window_tree) |
+ return nullptr; |
+ if (surface_type == mojom::SurfaceType::DEFAULT) { |
+ // At embed points the default surface comes from the embedded app. |
+ WindowTreeImpl* connection_with_root = GetConnectionWithRoot(ancestor); |
+ if (connection_with_root) |
+ window_tree = connection_with_root; |
+ } |
+ return window_tree->GetWindowByClientId(client_window_id); |
+} |
+ |
void ConnectionManager::OnWindowDestroyed(ServerWindow* window) { |
if (!in_destructor_) |
ProcessWindowDeleted(window); |