Index: ash/common/wm/root_window_layout_manager.cc |
diff --git a/ash/common/wm/root_window_layout_manager.cc b/ash/common/wm/root_window_layout_manager.cc |
index 15ec3fbfaaa0219b4aa5d078c9da5d5a12fa3be3..77ba63c45cf7c5da3c23b3c9c88c23bf99ba870e 100644 |
--- a/ash/common/wm/root_window_layout_manager.cc |
+++ b/ash/common/wm/root_window_layout_manager.cc |
@@ -9,6 +9,28 @@ |
#include "ui/aura/window_tracker.h" |
namespace ash { |
+ |
+namespace { |
+ |
+void ResizeWindow(const aura::Window::Windows& children, |
+ const gfx::Rect& fullscreen_bounds) { |
+ // Resize both our immediate children (the containers-of-containers animated |
+ // by PowerButtonController) and their children (the actual containers). |
+ aura::WindowTracker children_tracker(children); |
+ while (!children_tracker.windows().empty()) { |
+ aura::Window* child = children_tracker.Pop(); |
+ // Skip descendants of top-level windows, i.e. only resize containers and |
+ // other windows without a delegate, such as ScreenDimmer windows. |
+ if (child->GetToplevelWindow()) |
+ continue; |
+ |
+ child->SetBounds(fullscreen_bounds); |
+ ResizeWindow(child->children(), fullscreen_bounds); |
oshima
2017/04/05 20:26:51
I don't think this is right. There may be non top
wutao
2017/04/05 23:37:34
I will add a third parameter |depth| and return if
|
+ } |
+} |
+ |
+} // namespace |
+ |
namespace wm { |
//////////////////////////////////////////////////////////////////////////////// |
@@ -23,26 +45,8 @@ RootWindowLayoutManager::~RootWindowLayoutManager() {} |
// RootWindowLayoutManager, aura::LayoutManager implementation: |
void RootWindowLayoutManager::OnWindowResized() { |
- const gfx::Rect fullscreen_bounds = gfx::Rect(owner_->GetBounds().size()); |
- |
- // Resize both our immediate children (the containers-of-containers animated |
- // by PowerButtonController) and their children (the actual containers). |
- aura::WindowTracker children_tracker(owner_->aura_window()->children()); |
- while (!children_tracker.windows().empty()) { |
- aura::Window* child = children_tracker.Pop(); |
- // Skip descendants of top-level windows, i.e. only resize containers and |
- // other windows without a delegate, such as ScreenDimmer windows. |
- if (child->GetToplevelWindow()) |
- continue; |
- |
- child->SetBounds(fullscreen_bounds); |
- aura::WindowTracker grandchildren_tracker(child->children()); |
- while (!grandchildren_tracker.windows().empty()) { |
- child = grandchildren_tracker.Pop(); |
- if (!child->GetToplevelWindow()) |
- child->SetBounds(fullscreen_bounds); |
- } |
- } |
+ ResizeWindow(owner_->aura_window()->children(), |
+ gfx::Rect(owner_->GetBounds().size())); |
} |
void RootWindowLayoutManager::OnWindowAddedToLayout(WmWindow* child) {} |