OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_shell/desktop_layout_manager.h" | 5 #include "ui/aura_shell/desktop_layout_manager.h" |
6 | 6 |
7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
8 #include "views/widget/widget.h" | 8 #include "views/widget/widget.h" |
9 | 9 |
10 namespace aura_shell { | 10 namespace aura_shell { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
14 // DesktopLayoutManager, public: | 14 // DesktopLayoutManager, public: |
15 | 15 |
16 DesktopLayoutManager::DesktopLayoutManager(aura::Window* owner) | 16 DesktopLayoutManager::DesktopLayoutManager(aura::Window* owner) |
17 : owner_(owner), | 17 : owner_(owner), |
18 background_widget_(NULL), | 18 background_widget_(NULL), |
19 launcher_widget_(NULL), | 19 launcher_widget_(NULL), |
20 status_area_widget_(NULL) { | 20 status_area_widget_(NULL) { |
21 } | 21 } |
22 | 22 |
23 DesktopLayoutManager::~DesktopLayoutManager() { | 23 DesktopLayoutManager::~DesktopLayoutManager() { |
24 } | 24 } |
25 | 25 |
26 //////////////////////////////////////////////////////////////////////////////// | 26 //////////////////////////////////////////////////////////////////////////////// |
27 // DesktopLayoutManager, aura::LayoutManager implementation: | 27 // DesktopLayoutManager, aura::LayoutManager implementation: |
28 | 28 |
29 void DesktopLayoutManager::OnWindowResized() { | 29 void DesktopLayoutManager::OnWindowResized() { |
30 background_widget_->SetBounds( | 30 gfx::Rect fullscreen_bounds = |
31 gfx::Rect(owner_->bounds().width(), owner_->bounds().height())); | 31 gfx::Rect(owner_->bounds().width(), owner_->bounds().height()); |
| 32 toplevel_window_container_->SetBounds(fullscreen_bounds, 0); |
| 33 |
| 34 background_widget_->SetBounds(fullscreen_bounds); |
32 | 35 |
33 gfx::Rect launcher_bounds = launcher_widget_->GetWindowScreenBounds(); | 36 gfx::Rect launcher_bounds = launcher_widget_->GetWindowScreenBounds(); |
34 launcher_widget_->SetBounds( | 37 launcher_widget_->SetBounds( |
35 gfx::Rect(owner_->bounds().width() / 2 - launcher_bounds.width() / 2, | 38 gfx::Rect(owner_->bounds().width() / 2 - launcher_bounds.width() / 2, |
36 owner_->bounds().bottom() - launcher_bounds.height(), | 39 owner_->bounds().bottom() - launcher_bounds.height(), |
37 launcher_bounds.width(), | 40 launcher_bounds.width(), |
38 launcher_bounds.height())); | 41 launcher_bounds.height())); |
39 | 42 |
40 gfx::Rect status_area_bounds = status_area_widget_->GetWindowScreenBounds(); | 43 gfx::Rect status_area_bounds = status_area_widget_->GetWindowScreenBounds(); |
41 status_area_widget_->SetBounds( | 44 status_area_widget_->SetBounds( |
42 gfx::Rect(owner_->bounds().right() - status_area_bounds.width(), | 45 gfx::Rect(owner_->bounds().right() - status_area_bounds.width(), |
43 0, | 46 0, |
44 status_area_bounds.width(), | 47 status_area_bounds.width(), |
45 status_area_bounds.height())); | 48 status_area_bounds.height())); |
46 } | 49 } |
47 | 50 |
48 } // namespace internal | 51 } // namespace internal |
49 } // namespace aura_shell | 52 } // namespace aura_shell |
OLD | NEW |