summaryrefslogtreecommitdiffstats
path: root/ui/aura/window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/aura/window.cc')
-rw-r--r--ui/aura/window.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 6b4c5d2..d394d10 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));
}