| Index: ui/views/widget/desktop_layout_manager.cc
|
| diff --git a/ui/views/widget/desktop_layout_manager.cc b/ui/views/widget/desktop_layout_manager.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c012dbf1a4cbf09a0031c2c372e0d794c69ee4de
|
| --- /dev/null
|
| +++ b/ui/views/widget/desktop_layout_manager.cc
|
| @@ -0,0 +1,56 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ui/views/widget/desktop_layout_manager.h"
|
| +
|
| +#include "ui/aura/root_window.h"
|
| +#include "ui/gfx/rect.h"
|
| +
|
| +namespace views {
|
| +
|
| +DesktopLayoutManager::DesktopLayoutManager(aura::RootWindow* root_window)
|
| + : root_window_(root_window),
|
| + main_window_(NULL) {
|
| +}
|
| +
|
| +DesktopLayoutManager::~DesktopLayoutManager() {}
|
| +
|
| +void DesktopLayoutManager::OnWindowResized() {
|
| + if (main_window_)
|
| + SetMainWindowSize();
|
| +}
|
| +
|
| +void DesktopLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
|
| + if (!main_window_) {
|
| + main_window_ = child;
|
| +
|
| + SetMainWindowSize();
|
| + }
|
| +}
|
| +
|
| +void DesktopLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) {
|
| + if (main_window_ == child)
|
| + main_window_ = NULL;
|
| +}
|
| +
|
| +void DesktopLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
|
| +}
|
| +
|
| +void DesktopLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child,
|
| + bool visible) {
|
| +}
|
| +
|
| +void DesktopLayoutManager::SetChildBounds(aura::Window* child,
|
| + const gfx::Rect& requested_bounds) {
|
| + if (main_window_ != child)
|
| + SetChildBoundsDirect(child, requested_bounds);
|
| +}
|
| +
|
| +void DesktopLayoutManager::SetMainWindowSize() {
|
| + gfx::Rect bounds;
|
| + bounds.set_size(root_window_->GetHostSize());
|
| + SetChildBoundsDirect(main_window_, bounds);
|
| +}
|
| +
|
| +} // namespace views
|
|
|