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

Side by Side Diff: ash/common/wm/root_window_layout_manager.cc

Issue 2786563003: Add a NOT_DRAWN window in between the root_window and its children. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/public/cpp/shell_window_ids.h » ('j') | ash/root_window_controller.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/common/wm/root_window_layout_manager.h" 5 #include "ash/common/wm/root_window_layout_manager.h"
6 6
7 #include "ash/common/wm_window.h" 7 #include "ash/common/wm_window.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_tracker.h" 9 #include "ui/aura/window_tracker.h"
10 10
11 namespace ash { 11 namespace ash {
12
13 namespace {
14
15 void ResizeWindow(const aura::Window::Windows& children,
16 const gfx::Rect& fullscreen_bounds) {
17 // Resize both our immediate children (the containers-of-containers animated
18 // by PowerButtonController) and their children (the actual containers).
19 aura::WindowTracker children_tracker(children);
20 while (!children_tracker.windows().empty()) {
21 aura::Window* child = children_tracker.Pop();
22 // Skip descendants of top-level windows, i.e. only resize containers and
23 // other windows without a delegate, such as ScreenDimmer windows.
24 if (child->GetToplevelWindow())
25 continue;
26
27 child->SetBounds(fullscreen_bounds);
28 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
29 }
30 }
31
32 } // namespace
33
12 namespace wm { 34 namespace wm {
13 35
14 //////////////////////////////////////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////////////////////////
15 // RootWindowLayoutManager, public: 37 // RootWindowLayoutManager, public:
16 38
17 RootWindowLayoutManager::RootWindowLayoutManager(WmWindow* owner) 39 RootWindowLayoutManager::RootWindowLayoutManager(WmWindow* owner)
18 : owner_(owner) {} 40 : owner_(owner) {}
19 41
20 RootWindowLayoutManager::~RootWindowLayoutManager() {} 42 RootWindowLayoutManager::~RootWindowLayoutManager() {}
21 43
22 //////////////////////////////////////////////////////////////////////////////// 44 ////////////////////////////////////////////////////////////////////////////////
23 // RootWindowLayoutManager, aura::LayoutManager implementation: 45 // RootWindowLayoutManager, aura::LayoutManager implementation:
24 46
25 void RootWindowLayoutManager::OnWindowResized() { 47 void RootWindowLayoutManager::OnWindowResized() {
26 const gfx::Rect fullscreen_bounds = gfx::Rect(owner_->GetBounds().size()); 48 ResizeWindow(owner_->aura_window()->children(),
27 49 gfx::Rect(owner_->GetBounds().size()));
28 // Resize both our immediate children (the containers-of-containers animated
29 // by PowerButtonController) and their children (the actual containers).
30 aura::WindowTracker children_tracker(owner_->aura_window()->children());
31 while (!children_tracker.windows().empty()) {
32 aura::Window* child = children_tracker.Pop();
33 // Skip descendants of top-level windows, i.e. only resize containers and
34 // other windows without a delegate, such as ScreenDimmer windows.
35 if (child->GetToplevelWindow())
36 continue;
37
38 child->SetBounds(fullscreen_bounds);
39 aura::WindowTracker grandchildren_tracker(child->children());
40 while (!grandchildren_tracker.windows().empty()) {
41 child = grandchildren_tracker.Pop();
42 if (!child->GetToplevelWindow())
43 child->SetBounds(fullscreen_bounds);
44 }
45 }
46 } 50 }
47 51
48 void RootWindowLayoutManager::OnWindowAddedToLayout(WmWindow* child) {} 52 void RootWindowLayoutManager::OnWindowAddedToLayout(WmWindow* child) {}
49 53
50 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout(WmWindow* child) {} 54 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout(WmWindow* child) {}
51 55
52 void RootWindowLayoutManager::OnWindowRemovedFromLayout(WmWindow* child) {} 56 void RootWindowLayoutManager::OnWindowRemovedFromLayout(WmWindow* child) {}
53 57
54 void RootWindowLayoutManager::OnChildWindowVisibilityChanged(WmWindow* child, 58 void RootWindowLayoutManager::OnChildWindowVisibilityChanged(WmWindow* child,
55 bool visible) {} 59 bool visible) {}
56 60
57 void RootWindowLayoutManager::SetChildBounds( 61 void RootWindowLayoutManager::SetChildBounds(
58 WmWindow* child, 62 WmWindow* child,
59 const gfx::Rect& requested_bounds) { 63 const gfx::Rect& requested_bounds) {
60 child->SetBoundsDirect(requested_bounds); 64 child->SetBoundsDirect(requested_bounds);
61 } 65 }
62 66
63 } // namespace wm 67 } // namespace wm
64 } // namespace ash 68 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/public/cpp/shell_window_ids.h » ('j') | ash/root_window_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698