Index: ui/aura/window.cc |
diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
index 6b4c5d2553823dc126021633a0cf45583728585e..d394d106f6e79719fc8d1438c04739547129b439 100644 |
--- a/ui/aura/window.cc |
+++ b/ui/aura/window.cc |
@@ -277,6 +277,14 @@ void Window::RemoveChild(Window* child) { |
child->OnParentChanged(); |
} |
+bool Window::Contains(const Window* other) const { |
+ for (const Window* parent = other; parent; parent = parent->parent_) { |
+ if (parent == this) |
+ return true; |
+ } |
+ return false; |
+} |
+ |
Window* Window::GetChildById(int id) { |
return const_cast<Window*>(const_cast<const Window*>(this)->GetChildById(id)); |
} |