| 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 "ui/aura_shell/shelf_layout_controller.h" | |
| 9 #include "ui/views/widget/widget.h" | 8 #include "ui/views/widget/widget.h" |
| 10 | 9 |
| 11 namespace aura_shell { | 10 namespace aura_shell { |
| 12 namespace internal { | 11 namespace internal { |
| 13 | 12 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
| 15 // DesktopLayoutManager, public: | 14 // DesktopLayoutManager, public: |
| 16 | 15 |
| 17 DesktopLayoutManager::DesktopLayoutManager(aura::Window* owner) | 16 DesktopLayoutManager::DesktopLayoutManager(aura::Window* owner) |
| 18 : owner_(owner), | 17 : owner_(owner), |
| 19 background_widget_(NULL), | 18 background_widget_(NULL) { |
| 20 shelf_(NULL) { | |
| 21 } | 19 } |
| 22 | 20 |
| 23 DesktopLayoutManager::~DesktopLayoutManager() { | 21 DesktopLayoutManager::~DesktopLayoutManager() { |
| 24 } | 22 } |
| 25 | 23 |
| 26 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
| 27 // DesktopLayoutManager, aura::LayoutManager implementation: | 25 // DesktopLayoutManager, aura::LayoutManager implementation: |
| 28 | 26 |
| 29 void DesktopLayoutManager::OnWindowResized() { | 27 void DesktopLayoutManager::OnWindowResized() { |
| 30 gfx::Rect fullscreen_bounds = | 28 gfx::Rect fullscreen_bounds = |
| 31 gfx::Rect(owner_->bounds().width(), owner_->bounds().height()); | 29 gfx::Rect(owner_->bounds().width(), owner_->bounds().height()); |
| 32 | 30 |
| 33 aura::Window::Windows::const_iterator i; | 31 aura::Window::Windows::const_iterator i; |
| 34 for (i = owner_->children().begin(); i != owner_->children().end(); ++i) | 32 for (i = owner_->children().begin(); i != owner_->children().end(); ++i) |
| 35 (*i)->SetBounds(fullscreen_bounds); | 33 (*i)->SetBounds(fullscreen_bounds); |
| 36 | 34 |
| 37 background_widget_->SetBounds(fullscreen_bounds); | 35 background_widget_->SetBounds(fullscreen_bounds); |
| 38 | |
| 39 if (shelf_) | |
| 40 shelf_->LayoutShelf(); | |
| 41 } | 36 } |
| 42 | 37 |
| 43 void DesktopLayoutManager::OnWindowAddedToLayout(aura::Window* child) { | 38 void DesktopLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
| 44 } | 39 } |
| 45 | 40 |
| 46 void DesktopLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { | 41 void DesktopLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { |
| 47 } | 42 } |
| 48 | 43 |
| 49 void DesktopLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, | 44 void DesktopLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, |
| 50 bool visible) { | 45 bool visible) { |
| 51 } | 46 } |
| 52 | 47 |
| 53 void DesktopLayoutManager::SetChildBounds(aura::Window* child, | 48 void DesktopLayoutManager::SetChildBounds(aura::Window* child, |
| 54 const gfx::Rect& requested_bounds) { | 49 const gfx::Rect& requested_bounds) { |
| 55 SetChildBoundsDirect(child, requested_bounds); | 50 SetChildBoundsDirect(child, requested_bounds); |
| 56 } | 51 } |
| 57 | 52 |
| 58 | |
| 59 } // namespace internal | 53 } // namespace internal |
| 60 } // namespace aura_shell | 54 } // namespace aura_shell |
| OLD | NEW |