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_WINDOW_UTIL_H_ | 5 #ifndef ASH_WM_WINDOW_UTIL_H_ |
6 #define ASH_WM_WINDOW_UTIL_H_ | 6 #define ASH_WM_WINDOW_UTIL_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 ASH_EXPORT bool CanActivateWindow(aura::Window* window); | 29 ASH_EXPORT bool CanActivateWindow(aura::Window* window); |
30 | 30 |
31 // Retrieves the activatable window for |window|. If |window| is activatable, | 31 // Retrieves the activatable window for |window|. If |window| is activatable, |
32 // this will just return it, otherwise it will climb the parent/transient parent | 32 // this will just return it, otherwise it will climb the parent/transient parent |
33 // chain looking for a window that is activatable, per the ActivationController. | 33 // chain looking for a window that is activatable, per the ActivationController. |
34 // If you're looking for a function to get the activatable "top level" window, | 34 // If you're looking for a function to get the activatable "top level" window, |
35 // this is probably what you're looking for. | 35 // this is probably what you're looking for. |
36 ASH_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); | 36 ASH_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); |
37 | 37 |
38 // Returns true if |window| can be maximized. | 38 // Returns true if |window| can be maximized. |
39 ASH_EXPORT bool CanMaximizeWindow(aura::Window* window); | 39 ASH_EXPORT bool CanMaximizeWindow(const aura::Window* window); |
40 | 40 |
41 // Returns true if |window| is normal or default. | 41 // Returns true if |window| is normal or default. |
42 ASH_EXPORT bool IsWindowNormal(aura::Window* window); | 42 ASH_EXPORT bool IsWindowNormal(const aura::Window* window); |
43 | 43 |
44 // Returns true if |state| is normal or default. | 44 // Returns true if |state| is normal or default. |
45 ASH_EXPORT bool IsWindowStateNormal(ui::WindowShowState state); | 45 ASH_EXPORT bool IsWindowStateNormal(const ui::WindowShowState state); |
46 | 46 |
47 // Returns true if |window| is in the maximized state. | 47 // Returns true if |window| is in the maximized state. |
48 ASH_EXPORT bool IsWindowMaximized(aura::Window* window); | 48 ASH_EXPORT bool IsWindowMaximized(const aura::Window* window); |
49 | 49 |
50 // Returns true if |window| is minimized. | 50 // Returns true if |window| is minimized. |
51 ASH_EXPORT bool IsWindowMinimized(aura::Window* window); | 51 ASH_EXPORT bool IsWindowMinimized(const aura::Window* window); |
52 | 52 |
53 // Returns true if |window| is in the fullscreen state. | 53 // Returns true if |window| is in the fullscreen state. |
54 ASH_EXPORT bool IsWindowFullscreen(aura::Window* window); | 54 ASH_EXPORT bool IsWindowFullscreen(const aura::Window* window); |
55 | 55 |
56 // Maximizes |window|, which must not be NULL. | 56 // Maximizes |window|, which must not be NULL. |
57 ASH_EXPORT void MaximizeWindow(aura::Window* window); | 57 ASH_EXPORT void MaximizeWindow(aura::Window* window); |
58 | 58 |
59 // Minimizes |window|, which must not be NULL. | 59 // Minimizes |window|, which must not be NULL. |
60 ASH_EXPORT void MinimizeWindow(aura::Window* window); | 60 ASH_EXPORT void MinimizeWindow(aura::Window* window); |
61 | 61 |
62 // Restores |window|, which must not be NULL. | 62 // Restores |window|, which must not be NULL. |
63 ASH_EXPORT void RestoreWindow(aura::Window* window); | 63 ASH_EXPORT void RestoreWindow(aura::Window* window); |
64 | 64 |
65 // Moves the window to the center of the display. | 65 // Moves the window to the center of the display. |
66 ASH_EXPORT void CenterWindow(aura::Window* window); | 66 ASH_EXPORT void CenterWindow(aura::Window* window); |
67 | 67 |
68 // Returns the existing Layer for |window| (and all its descendants) and creates | 68 // Returns the existing Layer for |window| (and all its descendants) and creates |
69 // a new layer for |window| and all its descendants. This is intended for | 69 // a new layer for |window| and all its descendants. This is intended for |
70 // animations that want to animate between the existing visuals and a new window | 70 // animations that want to animate between the existing visuals and a new window |
71 // state. The caller owns the return value. | 71 // state. The caller owns the return value. |
72 // | 72 // |
73 // As a result of this |window| has freshly created layers, meaning the layers | 73 // As a result of this |window| has freshly created layers, meaning the layers |
74 // are all empty (nothing has been painted to them) and are sized to 0x0. Soon | 74 // are all empty (nothing has been painted to them) and are sized to 0x0. Soon |
75 // after this call you need to reset the bounds of the window. Or, you can pass | 75 // after this call you need to reset the bounds of the window. Or, you can pass |
76 // true as the second argument to let the function do that. | 76 // true as the second argument to let the function do that. |
77 ASH_EXPORT ui::Layer* RecreateWindowLayers(aura::Window* window, | 77 ASH_EXPORT ui::Layer* RecreateWindowLayers(aura::Window* window, |
78 bool set_bounds) WARN_UNUSED_RESULT; | 78 bool set_bounds) WARN_UNUSED_RESULT; |
79 | 79 |
80 // Deletes |layer| and all its child layers. | 80 // Deletes |layer| and all its child layers. |
81 ASH_EXPORT void DeepDeleteLayers(ui::Layer* layer); | 81 ASH_EXPORT void DeepDeleteLayers(ui::Layer* layer); |
82 | 82 |
83 // Returns true if |window|'s position can automatically be managed. | |
84 ASH_EXPORT bool IsWindowPositionManageable(const aura::Window* window); | |
sky
2012/10/11 19:50:54
Managed (same with 87).
Mr4D (OOO till 08-26)
2012/10/12 00:29:18
Done.
| |
85 | |
86 // Change the |window|'s position manageability to |manageable|. | |
87 ASH_EXPORT void SetWindowPositionManageable(aura::Window* window, | |
88 bool manageable); | |
89 | |
90 // Returns true if the user has changed the |window|'s position or size. | |
91 ASH_EXPORT bool HasUserChangedWindowPositionOrSize(const aura::Window* window); | |
92 | |
93 // Marks a |window|'s coordinates to be changed by a user. | |
94 ASH_EXPORT void UserHasChangedWindowPositionOrSize(aura::Window* window, | |
sky
2012/10/11 19:50:54
SetUserHas...
Mr4D (OOO till 08-26)
2012/10/12 00:29:18
Done.
| |
95 bool changed); | |
96 | |
83 } // namespace wm | 97 } // namespace wm |
84 } // namespace ash | 98 } // namespace ash |
85 | 99 |
86 #endif // ASH_WM_WINDOW_UTIL_H_ | 100 #endif // ASH_WM_WINDOW_UTIL_H_ |
OLD | NEW |