Enable snappy for IndexedDB.
[chromium-blink-merge.git] / ash / wm / root_window_layout_manager.cc
blob16620f658329317d1c411f51782d009ed8d2bf45
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/wm/root_window_layout_manager.h"
7 #include "ash/desktop_background/desktop_background_widget_controller.h"
8 #include "ash/root_window_controller.h"
9 #include "ui/aura/root_window.h"
10 #include "ui/compositor/layer.h"
11 #include "ui/views/widget/widget.h"
13 namespace ash {
14 namespace internal {
16 ////////////////////////////////////////////////////////////////////////////////
17 // RootWindowLayoutManager, public:
19 RootWindowLayoutManager::RootWindowLayoutManager(aura::Window* owner)
20 : owner_(owner) {
23 RootWindowLayoutManager::~RootWindowLayoutManager() {
27 ////////////////////////////////////////////////////////////////////////////////
28 // RootWindowLayoutManager, aura::LayoutManager implementation:
30 void RootWindowLayoutManager::OnWindowResized() {
31 gfx::Rect fullscreen_bounds =
32 gfx::Rect(owner_->bounds().width(), owner_->bounds().height());
34 // Resize both our immediate children (the containers-of-containers animated
35 // by PowerButtonController) and their children (the actual containers).
36 aura::Window::Windows::const_iterator i;
37 for (i = owner_->children().begin(); i != owner_->children().end(); ++i) {
38 (*i)->SetBounds(fullscreen_bounds);
39 aura::Window::Windows::const_iterator j;
40 for (j = (*i)->children().begin(); j != (*i)->children().end(); ++j)
41 (*j)->SetBounds(fullscreen_bounds);
43 RootWindowController* root_window_controller = GetRootWindowController(
44 static_cast<aura::RootWindow*>(owner_));
45 DesktopBackgroundWidgetController* background =
46 root_window_controller->wallpaper_controller();
48 if (!background && root_window_controller->animating_wallpaper_controller()) {
49 background = root_window_controller->animating_wallpaper_controller()->
50 GetController(false);
52 if (background)
53 background->SetBounds(fullscreen_bounds);
56 void RootWindowLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
59 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout(
60 aura::Window* child) {
63 void RootWindowLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
66 void RootWindowLayoutManager::OnChildWindowVisibilityChanged(
67 aura::Window* child,
68 bool visible) {
71 void RootWindowLayoutManager::SetChildBounds(
72 aura::Window* child,
73 const gfx::Rect& requested_bounds) {
74 SetChildBoundsDirect(child, requested_bounds);
77 } // namespace internal
78 } // namespace ash