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_CONNECTION_MANAGER_H_ | 5 #ifndef COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ |
6 #define COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ | 6 #define COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 const ServerWindow* old_parent); | 169 const ServerWindow* old_parent); |
170 void ProcessWindowHierarchyChanged(const ServerWindow* window, | 170 void ProcessWindowHierarchyChanged(const ServerWindow* window, |
171 const ServerWindow* new_parent, | 171 const ServerWindow* new_parent, |
172 const ServerWindow* old_parent); | 172 const ServerWindow* old_parent); |
173 void ProcessWindowReorder(const ServerWindow* window, | 173 void ProcessWindowReorder(const ServerWindow* window, |
174 const ServerWindow* relative_window, | 174 const ServerWindow* relative_window, |
175 const mojom::OrderDirection direction); | 175 const mojom::OrderDirection direction); |
176 void ProcessWindowDeleted(const ServerWindow* window); | 176 void ProcessWindowDeleted(const ServerWindow* window); |
177 void ProcessWillChangeWindowPredefinedCursor(ServerWindow* window, | 177 void ProcessWillChangeWindowPredefinedCursor(ServerWindow* window, |
178 int32_t cursor_id); | 178 int32_t cursor_id); |
| 179 void ProcessFrameDecorationValuesChanged(WindowTreeHostImpl* host); |
179 | 180 |
180 private: | 181 private: |
181 friend class Operation; | 182 friend class Operation; |
182 | 183 |
183 using ConnectionMap = std::map<ConnectionSpecificId, ClientConnection*>; | 184 using ConnectionMap = std::map<ConnectionSpecificId, ClientConnection*>; |
184 using HostConnectionMap = | 185 using HostConnectionMap = |
185 std::map<WindowTreeHostImpl*, WindowTreeHostConnection*>; | 186 std::map<WindowTreeHostImpl*, WindowTreeHostConnection*>; |
186 | 187 |
187 struct InFlightWindowManagerChange { | 188 struct InFlightWindowManagerChange { |
188 // Identifies the client that initiated the change. | 189 // Identifies the client that initiated the change. |
(...skipping 30 matching lines...) Expand all Loading... |
219 return current_operation_ && | 220 return current_operation_ && |
220 current_operation_->source_connection_id() == connection_id; | 221 current_operation_->source_connection_id() == connection_id; |
221 } | 222 } |
222 | 223 |
223 // Adds |connection| to internal maps. | 224 // Adds |connection| to internal maps. |
224 void AddConnection(ClientConnection* connection); | 225 void AddConnection(ClientConnection* connection); |
225 | 226 |
226 // Run in response to events which may cause us to change the native cursor. | 227 // Run in response to events which may cause us to change the native cursor. |
227 void MaybeUpdateNativeCursor(ServerWindow* window); | 228 void MaybeUpdateNativeCursor(ServerWindow* window); |
228 | 229 |
| 230 // Calls OnDisplays() on |observer|. |
| 231 void CallOnDisplays(mojom::DisplayManagerObserver* observer); |
| 232 |
| 233 // Calls observer->OnDisplaysChanged() with the display for |host|. |
| 234 void CallOnDisplayChanged(mojom::DisplayManagerObserver* observer, |
| 235 WindowTreeHostImpl* host); |
| 236 |
| 237 // Returns the Display for |host|. |
| 238 mojom::DisplayPtr DisplayForHost(WindowTreeHostImpl* host); |
| 239 |
229 // Overridden from ServerWindowDelegate: | 240 // Overridden from ServerWindowDelegate: |
230 mus::SurfacesState* GetSurfacesState() override; | 241 mus::SurfacesState* GetSurfacesState() override; |
231 void OnScheduleWindowPaint(const ServerWindow* window) override; | 242 void OnScheduleWindowPaint(const ServerWindow* window) override; |
232 const ServerWindow* GetRootWindow(const ServerWindow* window) const override; | 243 const ServerWindow* GetRootWindow(const ServerWindow* window) const override; |
233 void ScheduleSurfaceDestruction(ServerWindow* window) override; | 244 void ScheduleSurfaceDestruction(ServerWindow* window) override; |
234 | 245 |
235 // Overridden from ServerWindowObserver: | 246 // Overridden from ServerWindowObserver: |
236 void OnWindowDestroyed(ServerWindow* window) override; | 247 void OnWindowDestroyed(ServerWindow* window) override; |
237 void OnWillChangeWindowHierarchy(ServerWindow* window, | 248 void OnWillChangeWindowHierarchy(ServerWindow* window, |
238 ServerWindow* new_parent, | 249 ServerWindow* new_parent, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 bool in_destructor_; | 302 bool in_destructor_; |
292 | 303 |
293 // Maps from window manager change id to the client that initiated the | 304 // Maps from window manager change id to the client that initiated the |
294 // request. | 305 // request. |
295 InFlightWindowManagerChangeMap in_flight_wm_change_map_; | 306 InFlightWindowManagerChangeMap in_flight_wm_change_map_; |
296 | 307 |
297 // Next id supplied to the window manager. | 308 // Next id supplied to the window manager. |
298 uint32_t next_wm_change_id_; | 309 uint32_t next_wm_change_id_; |
299 | 310 |
300 mojo::WeakBindingSet<mojom::DisplayManager> display_manager_bindings_; | 311 mojo::WeakBindingSet<mojom::DisplayManager> display_manager_bindings_; |
| 312 // WARNING: only use these once |got_valid_frame_decorations_| is true. |
| 313 // TODO(sky): refactor this out into its own class. |
301 mojo::WeakInterfacePtrSet<mojom::DisplayManagerObserver> | 314 mojo::WeakInterfacePtrSet<mojom::DisplayManagerObserver> |
302 display_manager_observers_; | 315 display_manager_observers_; |
303 | 316 |
| 317 bool got_valid_frame_decorations_; |
| 318 |
304 DISALLOW_COPY_AND_ASSIGN(ConnectionManager); | 319 DISALLOW_COPY_AND_ASSIGN(ConnectionManager); |
305 }; | 320 }; |
306 | 321 |
307 } // namespace ws | 322 } // namespace ws |
308 } // namespace mus | 323 } // namespace mus |
309 | 324 |
310 #endif // COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ | 325 #endif // COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ |
OLD | NEW |