Index: services/ui/ws/window_tree.cc |
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc |
index 89ef41112b3c944243ac3b9822f10b336d9e6656..033b929a08a57240a012926e30fc7a3bcc154c5d 100644 |
--- a/services/ui/ws/window_tree.cc |
+++ b/services/ui/ws/window_tree.cc |
@@ -157,6 +157,14 @@ bool WindowTree::HasRoot(const ServerWindow* window) const { |
return roots_.count(window) > 0; |
} |
+const ServerWindow* WindowTree::FindRootFor(const ServerWindow* window) const { |
+ for (const ServerWindow* parent = window; parent; parent = parent->parent()) { |
+ if (roots_.count(parent)) |
+ return parent; |
+ } |
+ return nullptr; |
+} |
+ |
const ServerWindow* WindowTree::GetWindowByClientId( |
const ClientWindowId& id) const { |
auto iter = client_id_to_window_id_map_.find(id); |