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

Unified Diff: ash/wm/common/window_parenting_utils.cc

Issue 1901773002: Removes most of aura dependencies from DefaultState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wm_window_positioner
Patch Set: nit and merge Created 4 years, 8 months 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 | « ash/wm/common/window_parenting_utils.h ('k') | ash/wm/common/window_positioning_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/common/window_parenting_utils.cc
diff --git a/ash/wm/common/window_parenting_utils.cc b/ash/wm/common/window_parenting_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1e31fc4417ab261a5bc2a101686bd13ec0ee6e36
--- /dev/null
+++ b/ash/wm/common/window_parenting_utils.cc
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/wm/common/window_parenting_utils.h"
+
+#include "ash/wm/common/wm_window.h"
+
+namespace ash {
+namespace wm {
+
+void ReparentChildWithTransientChildren(WmWindow* child,
+ WmWindow* old_parent,
+ WmWindow* new_parent) {
+ if (child->GetParent() == old_parent)
+ new_parent->AddChild(child);
+ ReparentTransientChildrenOfChild(child, old_parent, new_parent);
+}
+
+void ReparentTransientChildrenOfChild(WmWindow* child,
+ WmWindow* old_parent,
+ WmWindow* new_parent) {
+ for (WmWindow* transient_child : child->GetTransientChildren())
+ ReparentChildWithTransientChildren(transient_child, old_parent, new_parent);
+}
+
+} // namespace wm
+} // namespace ash
« no previous file with comments | « ash/wm/common/window_parenting_utils.h ('k') | ash/wm/common/window_positioning_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698