16d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 26d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 36d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)// found in the LICENSE file. 46d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 51320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "athena/util/fill_layout_manager.h" 66d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 76d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)#include "base/logging.h" 86d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)#include "ui/aura/window.h" 96d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 106d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)namespace athena { 116d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 126d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)FillLayoutManager::FillLayoutManager(aura::Window* container) 136d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) : container_(container) { 146d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) DCHECK(container_); 156d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 166d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 176d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)FillLayoutManager::~FillLayoutManager() { 186d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 196d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 206d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)void FillLayoutManager::OnWindowResized() { 216d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) gfx::Rect full_bounds = gfx::Rect(container_->bounds().size()); 226d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) for (aura::Window::Windows::const_iterator iter = 236d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) container_->children().begin(); 246d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) iter != container_->children().end(); 256d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) ++iter) { 266d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) SetChildBoundsDirect(*iter, full_bounds); 276d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) } 286d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 296d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 306d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)void FillLayoutManager::OnWindowAddedToLayout(aura::Window* child) { 316d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) SetChildBoundsDirect(child, (gfx::Rect(container_->bounds().size()))); 326d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 336d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 346d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)void FillLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { 356d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 366d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)void FillLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) { 376d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 386d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)void FillLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, 396d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) bool visible) { 406d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 416d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)void FillLayoutManager::SetChildBounds(aura::Window* child, 426d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) const gfx::Rect& requested_bounds) { 436d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) // Ignore SetBounds request. 446d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} 456d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 466d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)} // namespace athena 47