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