Index: ui/aura/window.cc |
diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
index 90a8fed69cb5d9c921170bb663fe3874cd590db7..5160bf6c34fbd23f33c5f943d2a8fa9b325b5ba3 100644 |
--- a/ui/aura/window.cc |
+++ b/ui/aura/window.cc |
@@ -163,10 +163,10 @@ ui::Layer* Window::RecreateLayer() { |
UpdateLayerName(name_); |
layer_->SetFillsBoundsOpaquely(!transparent_); |
- // Install new layer as a sibling of the old layer, stacked on top of it. |
+ // Install new layer as a sibling of the old layer, stacked below it. |
sky
2013/05/28 14:03:50
Document why it's important to stack below rather
pkotwicz
2013/05/28 15:15:00
This is actually a bad diff, this change is not pa
|
if (old_layer->parent()) { |
old_layer->parent()->Add(layer_); |
- old_layer->parent()->StackAbove(layer_, old_layer); |
+ old_layer->parent()->StackBelow(layer_, old_layer); |
} |
// Migrate all the child layers over to the new layer. Copy the list because |
// the items are removed during iteration. |
@@ -340,6 +340,12 @@ void Window::StackChildAbove(Window* child, Window* target) { |
StackChildRelativeTo(child, target, STACK_ABOVE); |
} |
+void Window::StackChildAtBottom(Window* child) { |
+ if (children_.size() <= 1 || child == children_.front()) |
+ return; // At the bottom already. |
+ StackChildBelow(child, children_.front()); |
+} |
+ |
void Window::StackChildBelow(Window* child, Window* target) { |
StackChildRelativeTo(child, target, STACK_BELOW); |
} |