OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 void Window::StackChildAtTop(Window* child) { | 333 void Window::StackChildAtTop(Window* child) { |
334 if (children_.size() <= 1 || child == children_.back()) | 334 if (children_.size() <= 1 || child == children_.back()) |
335 return; // In the front already. | 335 return; // In the front already. |
336 StackChildAbove(child, children_.back()); | 336 StackChildAbove(child, children_.back()); |
337 } | 337 } |
338 | 338 |
339 void Window::StackChildAbove(Window* child, Window* target) { | 339 void Window::StackChildAbove(Window* child, Window* target) { |
340 StackChildRelativeTo(child, target, STACK_ABOVE); | 340 StackChildRelativeTo(child, target, STACK_ABOVE); |
341 } | 341 } |
342 | 342 |
| 343 void Window::StackChildAtBottom(Window* child) { |
| 344 if (children_.size() <= 1 || child == children_.front()) |
| 345 return; // At the bottom already. |
| 346 StackChildBelow(child, children_.front()); |
| 347 } |
| 348 |
343 void Window::StackChildBelow(Window* child, Window* target) { | 349 void Window::StackChildBelow(Window* child, Window* target) { |
344 StackChildRelativeTo(child, target, STACK_BELOW); | 350 StackChildRelativeTo(child, target, STACK_BELOW); |
345 } | 351 } |
346 | 352 |
347 void Window::AddChild(Window* child) { | 353 void Window::AddChild(Window* child) { |
348 WindowObserver::HierarchyChangeParams params; | 354 WindowObserver::HierarchyChangeParams params; |
349 params.target = child; | 355 params.target = child; |
350 params.new_parent = this; | 356 params.new_parent = this; |
351 params.old_parent = child->parent(); | 357 params.old_parent = child->parent(); |
352 params.phase = WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGING; | 358 params.phase = WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGING; |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 bool contains_mouse = false; | 1106 bool contains_mouse = false; |
1101 if (IsVisible()) { | 1107 if (IsVisible()) { |
1102 RootWindow* root_window = GetRootWindow(); | 1108 RootWindow* root_window = GetRootWindow(); |
1103 contains_mouse = root_window && | 1109 contains_mouse = root_window && |
1104 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); | 1110 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); |
1105 } | 1111 } |
1106 return contains_mouse; | 1112 return contains_mouse; |
1107 } | 1113 } |
1108 | 1114 |
1109 } // namespace aura | 1115 } // namespace aura |
OLD | NEW |