OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_MUS_WS_SERVER_WINDOW_H_ | 5 #ifndef COMPONENTS_MUS_WS_SERVER_WINDOW_H_ |
6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_H_ | 6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 std::vector<const ServerWindow*> GetChildren() const; | 94 std::vector<const ServerWindow*> GetChildren() const; |
95 std::vector<ServerWindow*> GetChildren(); | 95 std::vector<ServerWindow*> GetChildren(); |
96 const Windows& children() const { return children_; } | 96 const Windows& children() const { return children_; } |
97 | 97 |
98 // Returns the ServerWindow object with the provided |id| if it lies in a | 98 // Returns the ServerWindow object with the provided |id| if it lies in a |
99 // subtree of |this|. | 99 // subtree of |this|. |
100 ServerWindow* GetChildWindow(const WindowId& id); | 100 ServerWindow* GetChildWindow(const WindowId& id); |
101 | 101 |
102 // Transient window management. | 102 // Transient window management. |
103 // Adding transient child fails if the child window is modal to system. | 103 void AddTransientWindow(ServerWindow* child); |
104 bool AddTransientWindow(ServerWindow* child); | |
105 void RemoveTransientWindow(ServerWindow* child); | 104 void RemoveTransientWindow(ServerWindow* child); |
106 | 105 |
107 ServerWindow* transient_parent() { return transient_parent_; } | 106 ServerWindow* transient_parent() { return transient_parent_; } |
108 const ServerWindow* transient_parent() const { return transient_parent_; } | 107 const ServerWindow* transient_parent() const { return transient_parent_; } |
109 | 108 |
110 const Windows& transient_children() const { return transient_children_; } | 109 const Windows& transient_children() const { return transient_children_; } |
111 | 110 |
112 bool is_modal() const { return is_modal_; } | 111 bool is_modal() const { return is_modal_; } |
113 void SetModal(); | 112 void SetModal(); |
114 | 113 |
| 114 bool IsBlockedByModalWindow() const; |
| 115 |
| 116 // Returns the window that events targeted to this window should be retargeted |
| 117 // to; according to modal windows. If any modal window is blocking this |
| 118 // window, returns the topmost one; otherwise, returns this window. |
| 119 const ServerWindow* GetModalTarget() const; |
| 120 ServerWindow* GetModalTarget() { |
| 121 return const_cast<ServerWindow*>( |
| 122 static_cast<const ServerWindow*>(this)->GetModalTarget()); |
| 123 } |
| 124 |
115 // Returns true if this contains |window| or is |window|. | 125 // Returns true if this contains |window| or is |window|. |
116 bool Contains(const ServerWindow* window) const; | 126 bool Contains(const ServerWindow* window) const; |
117 | 127 |
118 // Returns the visibility requested by this window. IsDrawn() returns whether | 128 // Returns the visibility requested by this window. IsDrawn() returns whether |
119 // the window is actually visible on screen. | 129 // the window is actually visible on screen. |
120 bool visible() const { return visible_; } | 130 bool visible() const { return visible_; } |
121 void SetVisible(bool value); | 131 void SetVisible(bool value); |
122 | 132 |
123 float opacity() const { return opacity_; } | 133 float opacity() const { return opacity_; } |
124 void SetOpacity(float value); | 134 void SetOpacity(float value); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 233 |
224 base::ObserverList<ServerWindowObserver> observers_; | 234 base::ObserverList<ServerWindowObserver> observers_; |
225 | 235 |
226 DISALLOW_COPY_AND_ASSIGN(ServerWindow); | 236 DISALLOW_COPY_AND_ASSIGN(ServerWindow); |
227 }; | 237 }; |
228 | 238 |
229 } // namespace ws | 239 } // namespace ws |
230 } // namespace mus | 240 } // namespace mus |
231 | 241 |
232 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_H_ | 242 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_H_ |
OLD | NEW |