Only fsync leveldb's directory when the manifest is being updated.
[chromium-blink-merge.git] / ash / wm / system_background_controller.h
blob6da656345bd5bec50e09733c7e6c05848461e12a
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 #ifndef ASH_WM_SYSTEM_BACKGROUND_CONTROLLER_H_
6 #define ASH_WM_SYSTEM_BACKGROUND_CONTROLLER_H_
8 #include <string>
10 #include "ash/ash_export.h"
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "third_party/skia/include/core/SkColor.h"
14 #include "ui/aura/root_window_observer.h"
16 namespace aura {
17 class RootWindow;
20 namespace ui {
21 class Layer;
24 namespace ash {
25 namespace internal {
27 // SystemBackgroundController manages a ui::Layer that's stacked at the bottom
28 // of an aura::RootWindow's children. It exists solely to obscure portions of
29 // the root layer that aren't covered by any other layers (e.g. before the
30 // desktop background image is loaded at startup, or when we scale down all of
31 // the other layers as part of a power-button or window-management animation).
32 // It should never be transformed or restacked.
33 class SystemBackgroundController : public aura::RootWindowObserver {
34 public:
35 SystemBackgroundController(aura::RootWindow* root_window, SkColor color);
36 virtual ~SystemBackgroundController();
38 void SetColor(SkColor color);
40 // aura::RootWindowObserver overrides:
41 virtual void OnRootWindowResized(const aura::RootWindow* root,
42 const gfx::Size& old_size) OVERRIDE;
44 private:
45 class HostContentLayerDelegate;
47 aura::RootWindow* root_window_; // not owned
49 scoped_ptr<ui::Layer> layer_;
51 DISALLOW_COPY_AND_ASSIGN(SystemBackgroundController);
54 } // namespace internal
55 } // namespace ash
57 #endif // ASH_WM_SYSTEM_BACKGROUND_CONTROLLER_H_