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

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

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 years, 10 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
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 "ash/common/wm_window_tracker.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_tracker.h"
9 10
10 namespace ash { 11 namespace ash {
11 namespace wm { 12 namespace wm {
12 13
13 //////////////////////////////////////////////////////////////////////////////// 14 ////////////////////////////////////////////////////////////////////////////////
14 // RootWindowLayoutManager, public: 15 // RootWindowLayoutManager, public:
15 16
16 RootWindowLayoutManager::RootWindowLayoutManager(WmWindow* owner) 17 RootWindowLayoutManager::RootWindowLayoutManager(WmWindow* owner)
17 : owner_(owner) {} 18 : owner_(owner) {}
18 19
19 RootWindowLayoutManager::~RootWindowLayoutManager() {} 20 RootWindowLayoutManager::~RootWindowLayoutManager() {}
20 21
21 //////////////////////////////////////////////////////////////////////////////// 22 ////////////////////////////////////////////////////////////////////////////////
22 // RootWindowLayoutManager, aura::LayoutManager implementation: 23 // RootWindowLayoutManager, aura::LayoutManager implementation:
23 24
24 void RootWindowLayoutManager::OnWindowResized() { 25 void RootWindowLayoutManager::OnWindowResized() {
25 const gfx::Rect fullscreen_bounds = gfx::Rect(owner_->GetBounds().size()); 26 const gfx::Rect fullscreen_bounds = gfx::Rect(owner_->GetBounds().size());
26 27
27 // Resize both our immediate children (the containers-of-containers animated 28 // Resize both our immediate children (the containers-of-containers animated
28 // by PowerButtonController) and their children (the actual containers). 29 // by PowerButtonController) and their children (the actual containers).
29 WmWindowTracker children_tracker(owner_->GetChildren()); 30 aura::WindowTracker children_tracker(owner_->aura_window()->children());
30 while (!children_tracker.windows().empty()) { 31 while (!children_tracker.windows().empty()) {
31 WmWindow* child = children_tracker.Pop(); 32 aura::Window* child = children_tracker.Pop();
32 // Skip descendants of top-level windows, i.e. only resize containers and 33 // Skip descendants of top-level windows, i.e. only resize containers and
33 // other windows without a delegate, such as ScreenDimmer windows. 34 // other windows without a delegate, such as ScreenDimmer windows.
34 if (child->GetToplevelWindow()) 35 if (child->GetToplevelWindow())
35 continue; 36 continue;
36 37
37 child->SetBounds(fullscreen_bounds); 38 child->SetBounds(fullscreen_bounds);
38 WmWindowTracker grandchildren_tracker(child->GetChildren()); 39 aura::WindowTracker grandchildren_tracker(child->children());
39 while (!grandchildren_tracker.windows().empty()) { 40 while (!grandchildren_tracker.windows().empty()) {
40 child = grandchildren_tracker.Pop(); 41 child = grandchildren_tracker.Pop();
41 if (!child->GetToplevelWindow()) 42 if (!child->GetToplevelWindow())
42 child->SetBounds(fullscreen_bounds); 43 child->SetBounds(fullscreen_bounds);
43 } 44 }
44 } 45 }
45 } 46 }
46 47
47 void RootWindowLayoutManager::OnWindowAddedToLayout(WmWindow* child) {} 48 void RootWindowLayoutManager::OnWindowAddedToLayout(WmWindow* child) {}
48 49
49 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout(WmWindow* child) {} 50 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout(WmWindow* child) {}
50 51
51 void RootWindowLayoutManager::OnWindowRemovedFromLayout(WmWindow* child) {} 52 void RootWindowLayoutManager::OnWindowRemovedFromLayout(WmWindow* child) {}
52 53
53 void RootWindowLayoutManager::OnChildWindowVisibilityChanged(WmWindow* child, 54 void RootWindowLayoutManager::OnChildWindowVisibilityChanged(WmWindow* child,
54 bool visible) {} 55 bool visible) {}
55 56
56 void RootWindowLayoutManager::SetChildBounds( 57 void RootWindowLayoutManager::SetChildBounds(
57 WmWindow* child, 58 WmWindow* child,
58 const gfx::Rect& requested_bounds) { 59 const gfx::Rect& requested_bounds) {
59 child->SetBoundsDirect(requested_bounds); 60 child->SetBoundsDirect(requested_bounds);
60 } 61 }
61 62
62 } // namespace wm 63 } // namespace wm
63 } // namespace ash 64 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/panels/panel_layout_manager.cc ('k') | ash/common/wm/system_modal_container_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698