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_WINDOW_SERVER_H_ | 5 #ifndef SERVICES_UI_WS_WINDOW_SERVER_H_ |
6 #define SERVICES_UI_WS_WINDOW_SERVER_H_ | 6 #define SERVICES_UI_WS_WINDOW_SERVER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Sends an |event| to all WindowTrees belonging to |user_id| that might be | 189 // Sends an |event| to all WindowTrees belonging to |user_id| that might be |
190 // observing events. Skips |ignore_tree| if it is non-null. | 190 // observing events. Skips |ignore_tree| if it is non-null. |
191 void SendToEventObservers(const ui::Event& event, | 191 void SendToEventObservers(const ui::Event& event, |
192 const UserId& user_id, | 192 const UserId& user_id, |
193 WindowTree* ignore_tree); | 193 WindowTree* ignore_tree); |
194 | 194 |
195 // Sets a callback to be called whenever a ServerWindow is scheduled for | 195 // Sets a callback to be called whenever a ServerWindow is scheduled for |
196 // a [re]paint. This should only be called in a test configuration. | 196 // a [re]paint. This should only be called in a test configuration. |
197 void SetPaintCallback(const base::Callback<void(ServerWindow*)>& callback); | 197 void SetPaintCallback(const base::Callback<void(ServerWindow*)>& callback); |
198 | 198 |
| 199 void StartMoveLoop(uint32_t change_id, |
| 200 ServerWindow* window, |
| 201 WindowTree* initiator, |
| 202 const gfx::Rect& revert_bounds); |
| 203 void EndMoveLoop(); |
| 204 uint32_t GetCurrentMoveLoopChangeId(); |
| 205 ServerWindow* GetCurrentMoveLoopWindow(); |
| 206 WindowTree* GetCurrentMoveLoopInitiator(); |
| 207 gfx::Rect GetCurrentMoveLoopRevertBounds(); |
| 208 bool in_move_loop() const { return !!current_move_loop_; } |
| 209 |
199 private: | 210 private: |
| 211 struct CurrentMoveLoopState; |
200 friend class Operation; | 212 friend class Operation; |
201 | 213 |
202 using WindowTreeMap = | 214 using WindowTreeMap = |
203 std::map<ClientSpecificId, std::unique_ptr<WindowTree>>; | 215 std::map<ClientSpecificId, std::unique_ptr<WindowTree>>; |
204 using UserActivityMonitorMap = | 216 using UserActivityMonitorMap = |
205 std::map<UserId, std::unique_ptr<UserActivityMonitor>>; | 217 std::map<UserId, std::unique_ptr<UserActivityMonitor>>; |
206 | 218 |
207 struct InFlightWindowManagerChange { | 219 struct InFlightWindowManagerChange { |
208 // Identifies the client that initiated the change. | 220 // Identifies the client that initiated the change. |
209 ClientSpecificId client_id; | 221 ClientSpecificId client_id; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 WindowServerDelegate* delegate_; | 316 WindowServerDelegate* delegate_; |
305 | 317 |
306 // State for rendering into a Surface. | 318 // State for rendering into a Surface. |
307 scoped_refptr<ui::SurfacesState> surfaces_state_; | 319 scoped_refptr<ui::SurfacesState> surfaces_state_; |
308 | 320 |
309 // ID to use for next WindowTree. | 321 // ID to use for next WindowTree. |
310 ClientSpecificId next_client_id_; | 322 ClientSpecificId next_client_id_; |
311 | 323 |
312 std::unique_ptr<DisplayManager> display_manager_; | 324 std::unique_ptr<DisplayManager> display_manager_; |
313 | 325 |
| 326 std::unique_ptr<CurrentMoveLoopState> current_move_loop_; |
| 327 |
314 // Set of WindowTrees. | 328 // Set of WindowTrees. |
315 WindowTreeMap tree_map_; | 329 WindowTreeMap tree_map_; |
316 | 330 |
317 // If non-null then we're processing a client operation. The Operation is | 331 // If non-null then we're processing a client operation. The Operation is |
318 // not owned by us (it's created on the stack by WindowTree). | 332 // not owned by us (it's created on the stack by WindowTree). |
319 Operation* current_operation_; | 333 Operation* current_operation_; |
320 | 334 |
321 bool in_destructor_; | 335 bool in_destructor_; |
322 | 336 |
323 // Maps from window manager change id to the client that initiated the | 337 // Maps from window manager change id to the client that initiated the |
324 // request. | 338 // request. |
325 InFlightWindowManagerChangeMap in_flight_wm_change_map_; | 339 InFlightWindowManagerChangeMap in_flight_wm_change_map_; |
326 | 340 |
327 // Next id supplied to the window manager. | 341 // Next id supplied to the window manager. |
328 uint32_t next_wm_change_id_; | 342 uint32_t next_wm_change_id_; |
329 | 343 |
330 base::Callback<void(ServerWindow*)> window_paint_callback_; | 344 base::Callback<void(ServerWindow*)> window_paint_callback_; |
331 | 345 |
332 UserActivityMonitorMap activity_monitor_map_; | 346 UserActivityMonitorMap activity_monitor_map_; |
333 | 347 |
334 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; | 348 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; |
335 | 349 |
336 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 350 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
337 }; | 351 }; |
338 | 352 |
339 } // namespace ws | 353 } // namespace ws |
340 } // namespace ui | 354 } // namespace ui |
341 | 355 |
342 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 356 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
OLD | NEW |