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 SERVICES_UI_WS_SERVER_WINDOW_H_ | 5 #ifndef SERVICES_UI_WS_SERVER_WINDOW_H_ |
6 #define SERVICES_UI_WS_SERVER_WINDOW_H_ | 6 #define SERVICES_UI_WS_SERVER_WINDOW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void SetCanAcceptDrops(bool accepts_drags); | 99 void SetCanAcceptDrops(bool accepts_drags); |
100 | 100 |
101 ui::mojom::Cursor cursor() const { return cursor_id_; } | 101 ui::mojom::Cursor cursor() const { return cursor_id_; } |
102 ui::mojom::Cursor non_client_cursor() const { | 102 ui::mojom::Cursor non_client_cursor() const { |
103 return non_client_cursor_id_; | 103 return non_client_cursor_id_; |
104 } | 104 } |
105 | 105 |
106 const ServerWindow* parent() const { return parent_; } | 106 const ServerWindow* parent() const { return parent_; } |
107 ServerWindow* parent() { return parent_; } | 107 ServerWindow* parent() { return parent_; } |
108 | 108 |
| 109 // NOTE: this returns null if the window does not have an ancestor associated |
| 110 // with a display. |
109 const ServerWindow* GetRoot() const; | 111 const ServerWindow* GetRoot() const; |
110 ServerWindow* GetRoot() { | 112 ServerWindow* GetRoot() { |
111 return const_cast<ServerWindow*>( | 113 return const_cast<ServerWindow*>( |
112 const_cast<const ServerWindow*>(this)->GetRoot()); | 114 const_cast<const ServerWindow*>(this)->GetRoot()); |
113 } | 115 } |
114 | 116 |
115 const Windows& children() const { return children_; } | 117 const Windows& children() const { return children_; } |
116 | 118 |
117 // Returns the ServerWindow object with the provided |id| if it lies in a | 119 // Returns the ServerWindow object with the provided |id| if it lies in a |
118 // subtree of |this|. | 120 // subtree of |this|. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) | 201 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
200 std::string GetDebugWindowHierarchy() const; | 202 std::string GetDebugWindowHierarchy() const; |
201 std::string GetDebugWindowInfo() const; | 203 std::string GetDebugWindowInfo() const; |
202 void BuildDebugInfo(const std::string& depth, std::string* result) const; | 204 void BuildDebugInfo(const std::string& depth, std::string* result) const; |
203 #endif | 205 #endif |
204 | 206 |
205 private: | 207 private: |
206 // Implementation of removing a window. Doesn't send any notification. | 208 // Implementation of removing a window. Doesn't send any notification. |
207 void RemoveImpl(ServerWindow* window); | 209 void RemoveImpl(ServerWindow* window); |
208 | 210 |
| 211 // Called when the root window changes from |old_root| to |new_root|. This is |
| 212 // called after the window is moved from |old_root| to |new_root|. |
| 213 void ProcessRootChanged(ServerWindow* old_root, ServerWindow* new_root); |
| 214 |
209 // Called when this window's stacking order among its siblings is changed. | 215 // Called when this window's stacking order among its siblings is changed. |
210 void OnStackingChanged(); | 216 void OnStackingChanged(); |
211 | 217 |
212 static void ReorderImpl(ServerWindow* window, | 218 static void ReorderImpl(ServerWindow* window, |
213 ServerWindow* relative, | 219 ServerWindow* relative, |
214 mojom::OrderDirection diretion); | 220 mojom::OrderDirection diretion); |
215 | 221 |
216 // Returns a pointer to the stacking target that can be used by | 222 // Returns a pointer to the stacking target that can be used by |
217 // RestackTransientDescendants. | 223 // RestackTransientDescendants. |
218 static ServerWindow** GetStackingTarget(ServerWindow* window); | 224 static ServerWindow** GetStackingTarget(ServerWindow* window); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 268 |
263 base::ObserverList<ServerWindowObserver> observers_; | 269 base::ObserverList<ServerWindowObserver> observers_; |
264 | 270 |
265 DISALLOW_COPY_AND_ASSIGN(ServerWindow); | 271 DISALLOW_COPY_AND_ASSIGN(ServerWindow); |
266 }; | 272 }; |
267 | 273 |
268 } // namespace ws | 274 } // namespace ws |
269 } // namespace ui | 275 } // namespace ui |
270 | 276 |
271 #endif // SERVICES_UI_WS_SERVER_WINDOW_H_ | 277 #endif // SERVICES_UI_WS_SERVER_WINDOW_H_ |
OLD | NEW |