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 "ash/wm/root_window_layout_manager.h" | 5 #include "ash/wm/root_window_layout_manager.h" |
6 | 6 |
| 7 #include "ash/shell.h" |
7 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
8 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
9 | 10 |
10 namespace ash { | 11 namespace ash { |
11 namespace internal { | 12 namespace internal { |
12 | 13 |
13 //////////////////////////////////////////////////////////////////////////////// | 14 //////////////////////////////////////////////////////////////////////////////// |
14 // RootWindowLayoutManager, public: | 15 // RootWindowLayoutManager, public: |
15 | 16 |
16 RootWindowLayoutManager::RootWindowLayoutManager(aura::Window* owner) | 17 RootWindowLayoutManager::RootWindowLayoutManager(aura::Window* owner) |
(...skipping 12 matching lines...) Expand all Loading... |
29 background_widget_ = widget; | 30 background_widget_ = widget; |
30 } | 31 } |
31 | 32 |
32 //////////////////////////////////////////////////////////////////////////////// | 33 //////////////////////////////////////////////////////////////////////////////// |
33 // RootWindowLayoutManager, aura::LayoutManager implementation: | 34 // RootWindowLayoutManager, aura::LayoutManager implementation: |
34 | 35 |
35 void RootWindowLayoutManager::OnWindowResized() { | 36 void RootWindowLayoutManager::OnWindowResized() { |
36 gfx::Rect fullscreen_bounds = | 37 gfx::Rect fullscreen_bounds = |
37 gfx::Rect(owner_->bounds().width(), owner_->bounds().height()); | 38 gfx::Rect(owner_->bounds().width(), owner_->bounds().height()); |
38 | 39 |
| 40 // Change window mode before setting bounds on children so the children will |
| 41 // resize to fit the new workspace area. |
| 42 Shell::GetInstance()->SetWindowModeForMonitorSize(fullscreen_bounds.size()); |
| 43 |
39 aura::Window::Windows::const_iterator i; | 44 aura::Window::Windows::const_iterator i; |
40 for (i = owner_->children().begin(); i != owner_->children().end(); ++i) | 45 for (i = owner_->children().begin(); i != owner_->children().end(); ++i) |
41 (*i)->SetBounds(fullscreen_bounds); | 46 (*i)->SetBounds(fullscreen_bounds); |
42 | 47 |
43 if (background_widget_) | 48 if (background_widget_) |
44 background_widget_->SetBounds(fullscreen_bounds); | 49 background_widget_->SetBounds(fullscreen_bounds); |
45 } | 50 } |
46 | 51 |
47 void RootWindowLayoutManager::OnWindowAddedToLayout(aura::Window* child) { | 52 void RootWindowLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
48 } | 53 } |
49 | 54 |
50 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout( | 55 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout( |
51 aura::Window* child) { | 56 aura::Window* child) { |
52 } | 57 } |
53 | 58 |
54 void RootWindowLayoutManager::OnChildWindowVisibilityChanged( | 59 void RootWindowLayoutManager::OnChildWindowVisibilityChanged( |
55 aura::Window* child, | 60 aura::Window* child, |
56 bool visible) { | 61 bool visible) { |
57 } | 62 } |
58 | 63 |
59 void RootWindowLayoutManager::SetChildBounds( | 64 void RootWindowLayoutManager::SetChildBounds( |
60 aura::Window* child, | 65 aura::Window* child, |
61 const gfx::Rect& requested_bounds) { | 66 const gfx::Rect& requested_bounds) { |
62 SetChildBoundsDirect(child, requested_bounds); | 67 SetChildBoundsDirect(child, requested_bounds); |
63 } | 68 } |
64 | 69 |
65 } // namespace internal | 70 } // namespace internal |
66 } // namespace ash | 71 } // namespace ash |
OLD | NEW |