| 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 { |
| 11 namespace internal { |
| 12 |
| 10 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
| 11 // DesktopLayoutManager, public: | 14 // DesktopLayoutManager, public: |
| 12 | 15 |
| 13 DesktopLayoutManager::DesktopLayoutManager(aura::Window* owner) | 16 DesktopLayoutManager::DesktopLayoutManager(aura::Window* owner) |
| 14 : owner_(owner), | 17 : owner_(owner), |
| 15 background_widget_(NULL) { | 18 background_widget_(NULL), |
| 19 launcher_widget_(NULL) { |
| 16 } | 20 } |
| 17 | 21 |
| 18 DesktopLayoutManager::~DesktopLayoutManager() { | 22 DesktopLayoutManager::~DesktopLayoutManager() { |
| 19 } | 23 } |
| 20 | 24 |
| 21 //////////////////////////////////////////////////////////////////////////////// | 25 //////////////////////////////////////////////////////////////////////////////// |
| 22 // DesktopLayoutManager, aura::LayoutManager implementation: | 26 // DesktopLayoutManager, aura::LayoutManager implementation: |
| 23 | 27 |
| 24 void DesktopLayoutManager::OnWindowResized() { | 28 void DesktopLayoutManager::OnWindowResized() { |
| 25 background_widget_->SetBounds( | 29 background_widget_->SetBounds( |
| 26 gfx::Rect(owner_->bounds().width(), owner_->bounds().height())); | 30 gfx::Rect(owner_->bounds().width(), owner_->bounds().height())); |
| 31 |
| 32 gfx::Rect launcher_bounds = launcher_widget_->GetWindowScreenBounds(); |
| 33 launcher_widget_->SetBounds( |
| 34 gfx::Rect(owner_->bounds().width() / 2 - launcher_bounds.width() / 2, |
| 35 owner_->bounds().bottom() - launcher_bounds.height(), |
| 36 launcher_bounds.width(), |
| 37 launcher_bounds.height())); |
| 27 } | 38 } |
| 39 |
| 40 } // namespace internal |
| 41 } // namespace aura_shell |
| OLD | NEW |