OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_WM_PROPERTY_UTIL_H_ | 5 #ifndef ASH_WM_PROPERTY_UTIL_H_ |
6 #define ASH_WM_PROPERTY_UTIL_H_ | 6 #define ASH_WM_PROPERTY_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 | 10 |
11 namespace aura { | 11 namespace aura { |
12 class Window; | 12 class Window; |
13 template<typename T> | |
14 struct WindowProperty; | |
15 } | 13 } |
16 | 14 |
17 namespace gfx { | 15 namespace gfx { |
18 class Rect; | 16 class Rect; |
19 } | 17 } |
20 | 18 |
21 namespace ash { | 19 namespace ash { |
22 | 20 |
23 // Sets the restore bounds property on |window|. Deletes existing bounds value | 21 // Sets the restore bounds property on |window|. Deletes existing bounds value |
24 // if exists. | 22 // if exists. |
25 ASH_EXPORT void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds); | 23 ASH_EXPORT void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds); |
26 | 24 |
27 // Same as SetRestoreBounds(), but does nothing if the restore bounds have | 25 // Same as SetRestoreBounds(), but does nothing if the restore bounds have |
28 // already been set. The bounds used are the bounds of the window. | 26 // already been set. The bounds used are the bounds of the window. |
29 ASH_EXPORT void SetRestoreBoundsIfNotSet(aura::Window* window); | 27 ASH_EXPORT void SetRestoreBoundsIfNotSet(aura::Window* window); |
30 | 28 |
31 // Returns the restore bounds property on |window|. NULL if the | 29 // Returns the restore bounds property on |window|. NULL if the |
32 // restore bounds property does not exist for |window|. |window| | 30 // restore bounds property does not exist for |window|. |window| |
33 // owns the bounds object. | 31 // owns the bounds object. |
34 ASH_EXPORT const gfx::Rect* GetRestoreBounds(aura::Window* window); | 32 ASH_EXPORT const gfx::Rect* GetRestoreBounds(aura::Window* window); |
35 | 33 |
36 // Deletes and clears the restore bounds property on |window|. | 34 // Deletes and clears the restore bounds property on |window|. |
37 ASH_EXPORT void ClearRestoreBounds(aura::Window* window); | 35 ASH_EXPORT void ClearRestoreBounds(aura::Window* window); |
38 | 36 |
39 // Toggles the maximized state of the specified window. | 37 // Toggles the maximized state of the specified window. |
40 ASH_EXPORT void ToggleMaximizedState(aura::Window* window); | 38 ASH_EXPORT void ToggleMaximizedState(aura::Window* window); |
41 | 39 |
42 ASH_EXPORT extern const aura::WindowProperty<bool>* const | |
43 kWindowTrackedByWorkspaceSplitPropKey; | |
44 | |
45 // Sets whether the specified window is tracked by workspace code. Default is | |
46 // true. If set to false the workspace does not switch the current workspace, | |
47 // nor does it attempt to impose constraints on the bounds of the window. This | |
48 // is intended for tab dragging. | |
49 ASH_EXPORT void SetTrackedByWorkspace(aura::Window* window, bool value); | |
50 ASH_EXPORT bool GetTrackedByWorkspace(aura::Window* window); | |
51 | |
52 } | 40 } |
53 | 41 |
54 #endif // ASH_WM_PROPERTY_UTIL_H_ | 42 #endif // ASH_WM_PROPERTY_UTIL_H_ |
OLD | NEW |