Only fsync leveldb's directory when the manifest is being updated.
[chromium-blink-merge.git] / ash / wm / root_window_layout_manager.cc
blob481fe3f6c08962cce8ce12f72d3fcded41e34b10
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 "ui/aura/window.h"
9 #include "ui/compositor/layer.h"
10 #include "ui/views/widget/widget.h"
12 namespace ash {
13 namespace internal {
15 ////////////////////////////////////////////////////////////////////////////////
16 // RootWindowLayoutManager, public:
18 RootWindowLayoutManager::RootWindowLayoutManager(aura::Window* owner)
19 : owner_(owner) {
22 RootWindowLayoutManager::~RootWindowLayoutManager() {
26 ////////////////////////////////////////////////////////////////////////////////
27 // RootWindowLayoutManager, aura::LayoutManager implementation:
29 void RootWindowLayoutManager::OnWindowResized() {
30 gfx::Rect fullscreen_bounds =
31 gfx::Rect(owner_->bounds().width(), owner_->bounds().height());
33 // Resize both our immediate children (the containers-of-containers animated
34 // by PowerButtonController) and their children (the actual containers).
35 aura::Window::Windows::const_iterator i;
36 for (i = owner_->children().begin(); i != owner_->children().end(); ++i) {
37 (*i)->SetBounds(fullscreen_bounds);
38 aura::Window::Windows::const_iterator j;
39 for (j = (*i)->children().begin(); j != (*i)->children().end(); ++j)
40 (*j)->SetBounds(fullscreen_bounds);
42 internal::DesktopBackgroundWidgetController* background =
43 owner_->GetProperty(kDesktopController);
44 if (!background && owner_->GetProperty(kAnimatingDesktopController)) {
45 background = owner_->GetProperty(kAnimatingDesktopController)->
46 GetController(false);
48 if (background)
49 background->SetBounds(fullscreen_bounds);
52 void RootWindowLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
55 void RootWindowLayoutManager::OnWillRemoveWindowFromLayout(
56 aura::Window* child) {
59 void RootWindowLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
62 void RootWindowLayoutManager::OnChildWindowVisibilityChanged(
63 aura::Window* child,
64 bool visible) {
67 void RootWindowLayoutManager::SetChildBounds(
68 aura::Window* child,
69 const gfx::Rect& requested_bounds) {
70 SetChildBoundsDirect(child, requested_bounds);
73 } // namespace internal
74 } // namespace ash