Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: ui/aura/window.cc

Issue 8700013: Release aura::Desktop event handler windows on detaching an ancestor window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test for Window::Contains. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698