Only fsync leveldb's directory when the manifest is being updated.
[chromium-blink-merge.git] / ash / wm / property_util.h
blob97d7b24b4cac6f16b0e5e867f407ec34e29b82bf
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_PROPERTY_UTIL_H_
6 #define ASH_WM_PROPERTY_UTIL_H_
8 #include "ash/ash_export.h"
10 namespace aura {
11 class RootWindow;
12 class Window;
15 namespace gfx {
16 class Rect;
19 namespace ash {
20 namespace internal {
21 class RootWindowController;
24 // Sets the restore bounds property on |window| in the virtual screen
25 // coordinates. Deletes existing bounds value if exists.
26 ASH_EXPORT void SetRestoreBoundsInScreen(aura::Window* window,
27 const gfx::Rect& screen_bounds);
28 // Same as |SetRestoreBoundsInScreen| except that the bounds is in the
29 // parent's coordinates.
30 ASH_EXPORT void SetRestoreBoundsInParent(aura::Window* window,
31 const gfx::Rect& parent_bounds);
33 // Returns the restore bounds property on |window| in the virtual screen
34 // coordinates. The bounds can be NULL if the bounds property does not
35 // exist for |window|. |window| owns the bounds object.
36 ASH_EXPORT const gfx::Rect* GetRestoreBoundsInScreen(aura::Window* window);
37 // Same as |GetRestoreBoundsInScreen| except that it returns the
38 // bounds in the parent's coordinates.
39 ASH_EXPORT gfx::Rect GetRestoreBoundsInParent(aura::Window* window);
41 // Deletes and clears the restore bounds property on |window|.
42 ASH_EXPORT void ClearRestoreBounds(aura::Window* window);
44 enum WindowPersistsAcrossAllWorkspacesType {
45 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_DEFAULT,
46 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_NO,
47 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES,
50 // Sets whether |window| is ignored when determining whether the shelf should
51 // be darkened when overlapped.
52 ASH_EXPORT void SetIgnoredByShelf(aura::Window* window, bool value);
53 ASH_EXPORT bool GetIgnoredByShelf(const aura::Window* window);
55 // Sets whether |window| should always be restored to the restore bounds
56 // (sometimes the workspace layout manager restores the window to its original
57 // bounds instead of the restore bounds. Setting this key overrides that
58 // behaviour). The flag is reset to the default value after the window is
59 // restored.
60 ASH_EXPORT void SetWindowAlwaysRestoresToRestoreBounds(aura::Window* window,
61 bool value);
62 ASH_EXPORT bool GetWindowAlwaysRestoresToRestoreBounds(
63 const aura::Window* window);
65 // Sets whether the specified window is tracked by workspace code. Default is
66 // true. If set to false the workspace does not switch the current workspace,
67 // nor does it attempt to impose constraints on the bounds of the window. This
68 // is intended for tab dragging.
69 ASH_EXPORT void SetTrackedByWorkspace(aura::Window* window, bool value);
70 ASH_EXPORT bool GetTrackedByWorkspace(const aura::Window* window);
72 // Makes |window| persist across all workspaces. The default is controlled
73 // by SetDefaultPersistsAcrossAllWorkspaces().
74 ASH_EXPORT void SetPersistsAcrossAllWorkspaces(
75 aura::Window* window,
76 WindowPersistsAcrossAllWorkspacesType type);
77 ASH_EXPORT bool GetPersistsAcrossAllWorkspaces(aura::Window* window);
79 // Sets the default value for whether windows persist across all workspaces.
80 // The default is false.
81 ASH_EXPORT void SetDefaultPersistsAcrossAllWorkspaces(bool value);
83 // Sets/Gets the RootWindowController for |root_window|.
84 ASH_EXPORT void SetRootWindowController(
85 aura::RootWindow* root_window,
86 internal::RootWindowController* controller);
87 ASH_EXPORT internal::RootWindowController* GetRootWindowController(
88 const aura::RootWindow* root_window);
92 #endif // ASH_WM_PROPERTY_UTIL_H_