Chromium Code Reviews| Index: ui/aura/window.cc |
| diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
| index 6b4c5d2553823dc126021633a0cf45583728585e..49676f0cc7d825bfec152bb594666f2b9fc0731c 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()) { |
|
sky
2011/11/28 21:55:25
nit: use parent->parent_ here.
flackr
2011/11/29 14:54:14
Done.
|
| + if (parent == this) |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| Window* Window::GetChildById(int id) { |
| return const_cast<Window*>(const_cast<const Window*>(this)->GetChildById(id)); |
| } |