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 UI_WM_CORE_WINDOW_UTIL_H_ | 5 #ifndef UI_WM_CORE_WINDOW_UTIL_H_ |
6 #define UI_WM_CORE_WINDOW_UTIL_H_ | 6 #define UI_WM_CORE_WINDOW_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "ui/wm/core/wm_core_export.h" | 13 #include "ui/wm/wm_export.h" |
14 | 14 |
15 namespace aura { | 15 namespace aura { |
16 class Window; | 16 class Window; |
17 } | 17 } |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 class Layer; | 20 class Layer; |
21 class LayerOwner; | 21 class LayerOwner; |
22 class LayerTreeOwner; | 22 class LayerTreeOwner; |
23 } | 23 } |
24 | 24 |
25 namespace wm { | 25 namespace wm { |
26 | 26 |
27 WM_CORE_EXPORT void ActivateWindow(aura::Window* window); | 27 WM_EXPORT void ActivateWindow(aura::Window* window); |
28 WM_CORE_EXPORT void DeactivateWindow(aura::Window* window); | 28 WM_EXPORT void DeactivateWindow(aura::Window* window); |
29 WM_CORE_EXPORT bool IsActiveWindow(aura::Window* window); | 29 WM_EXPORT bool IsActiveWindow(aura::Window* window); |
30 WM_CORE_EXPORT bool CanActivateWindow(aura::Window* window); | 30 WM_EXPORT bool CanActivateWindow(aura::Window* window); |
31 | 31 |
32 // Retrieves the activatable window for |window|. The ActivationClient makes | 32 // Retrieves the activatable window for |window|. The ActivationClient makes |
33 // this determination. | 33 // this determination. |
34 WM_CORE_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); | 34 WM_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); |
35 | 35 |
36 // Retrieves the toplevel window for |window|. The ActivationClient makes this | 36 // Retrieves the toplevel window for |window|. The ActivationClient makes this |
37 // determination. | 37 // determination. |
38 WM_CORE_EXPORT aura::Window* GetToplevelWindow(aura::Window* window); | 38 WM_EXPORT aura::Window* GetToplevelWindow(aura::Window* window); |
39 | 39 |
40 // Returns the existing Layer for |root| (and all its descendants) and creates | 40 // Returns the existing Layer for |root| (and all its descendants) and creates |
41 // a new layer for |root| and all its descendants. This is intended for | 41 // a new layer for |root| and all its descendants. This is intended for |
42 // animations that want to animate between the existing visuals and a new state. | 42 // animations that want to animate between the existing visuals and a new state. |
43 // | 43 // |
44 // As a result of this |root| has freshly created layers, meaning the layers | 44 // As a result of this |root| has freshly created layers, meaning the layers |
45 // have not yet been painted to. | 45 // have not yet been painted to. |
46 WM_CORE_EXPORT scoped_ptr<ui::LayerTreeOwner> RecreateLayers( | 46 WM_EXPORT scoped_ptr<ui::LayerTreeOwner> RecreateLayers( |
47 ui::LayerOwner* root); | 47 ui::LayerOwner* root); |
48 | 48 |
49 // Convenience functions that get the TransientWindowManager for the window and | 49 // Convenience functions that get the TransientWindowManager for the window and |
50 // redirect appropriately. These are preferable to calling functions on | 50 // redirect appropriately. These are preferable to calling functions on |
51 // TransientWindowManager as they handle the appropriate NULL checks. | 51 // TransientWindowManager as they handle the appropriate NULL checks. |
52 WM_CORE_EXPORT aura::Window* GetTransientParent(aura::Window* window); | 52 WM_EXPORT aura::Window* GetTransientParent(aura::Window* window); |
53 WM_CORE_EXPORT const aura::Window* GetTransientParent( | 53 WM_EXPORT const aura::Window* GetTransientParent( |
54 const aura::Window* window); | 54 const aura::Window* window); |
55 WM_CORE_EXPORT const std::vector<aura::Window*>& GetTransientChildren( | 55 WM_EXPORT const std::vector<aura::Window*>& GetTransientChildren( |
56 const aura::Window* window); | 56 const aura::Window* window); |
57 WM_CORE_EXPORT void AddTransientChild(aura::Window* parent, | 57 WM_EXPORT void AddTransientChild(aura::Window* parent, aura::Window* child); |
58 aura::Window* child); | 58 WM_EXPORT void RemoveTransientChild(aura::Window* parent, aura::Window* child); |
59 WM_CORE_EXPORT void RemoveTransientChild(aura::Window* parent, | |
60 aura::Window* child); | |
61 | 59 |
62 // Returns true if |window| has |ancestor| as a transient ancestor. A transient | 60 // Returns true if |window| has |ancestor| as a transient ancestor. A transient |
63 // ancestor is found by following the transient parent chain of the window. | 61 // ancestor is found by following the transient parent chain of the window. |
64 WM_CORE_EXPORT bool HasTransientAncestor(const aura::Window* window, | 62 WM_EXPORT bool HasTransientAncestor(const aura::Window* window, |
65 const aura::Window* ancestor); | 63 const aura::Window* ancestor); |
66 | 64 |
67 } // namespace wm | 65 } // namespace wm |
68 | 66 |
69 #endif // UI_WM_CORE_WINDOW_UTIL_H_ | 67 #endif // UI_WM_CORE_WINDOW_UTIL_H_ |
OLD | NEW |