Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: services/ui/ws/window_server.h

Issue 2266603002: mus: Implement interwindow drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/optional.h"
16 #include "mojo/public/cpp/bindings/array.h" 17 #include "mojo/public/cpp/bindings/array.h"
17 #include "mojo/public/cpp/bindings/binding.h" 18 #include "mojo/public/cpp/bindings/binding.h"
18 #include "services/ui/clipboard/clipboard_impl.h" 19 #include "services/ui/clipboard/clipboard_impl.h"
19 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom .h" 20 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom .h"
20 #include "services/ui/public/interfaces/window_tree.mojom.h" 21 #include "services/ui/public/interfaces/window_tree.mojom.h"
21 #include "services/ui/public/interfaces/window_tree_host.mojom.h" 22 #include "services/ui/public/interfaces/window_tree_host.mojom.h"
22 #include "services/ui/surfaces/surfaces_state.h" 23 #include "services/ui/surfaces/surfaces_state.h"
23 #include "services/ui/ws/display.h" 24 #include "services/ui/ws/display.h"
24 #include "services/ui/ws/gpu_service_proxy_delegate.h" 25 #include "services/ui/ws/gpu_service_proxy_delegate.h"
25 #include "services/ui/ws/ids.h" 26 #include "services/ui/ws/ids.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 ServerWindow* window, 214 ServerWindow* window,
214 WindowTree* initiator, 215 WindowTree* initiator,
215 const gfx::Rect& revert_bounds); 216 const gfx::Rect& revert_bounds);
216 void EndMoveLoop(); 217 void EndMoveLoop();
217 uint32_t GetCurrentMoveLoopChangeId(); 218 uint32_t GetCurrentMoveLoopChangeId();
218 ServerWindow* GetCurrentMoveLoopWindow(); 219 ServerWindow* GetCurrentMoveLoopWindow();
219 WindowTree* GetCurrentMoveLoopInitiator(); 220 WindowTree* GetCurrentMoveLoopInitiator();
220 gfx::Rect GetCurrentMoveLoopRevertBounds(); 221 gfx::Rect GetCurrentMoveLoopRevertBounds();
221 bool in_move_loop() const { return !!current_move_loop_; } 222 bool in_move_loop() const { return !!current_move_loop_; }
222 223
224 void StartDragLoop(uint32_t change_id,
225 ServerWindow* window,
226 WindowTree* initiator);
227 void EndDragLoop();
228 uint32_t GetCurrentDragLoopChangeId();
229 ServerWindow* GetCurrentDragLoopWindow();
230 WindowTree* GetCurrentDragLoopInitiator();
231 bool in_drag_loop() const { return !!current_drag_loop_; }
232
223 void OnDisplayReady(Display* display, bool is_first); 233 void OnDisplayReady(Display* display, bool is_first);
224 void OnNoMoreDisplays(); 234 void OnNoMoreDisplays();
225 WindowManagerState* GetWindowManagerStateForUser(const UserId& user_id); 235 WindowManagerState* GetWindowManagerStateForUser(const UserId& user_id);
226 236
227 // ServerWindowDelegate: 237 // ServerWindowDelegate:
228 ui::SurfacesState* GetSurfacesState() override; 238 ui::SurfacesState* GetSurfacesState() override;
229 239
230 // UserDisplayManagerDelegate: 240 // UserDisplayManagerDelegate:
231 bool GetFrameDecorationsForUser( 241 bool GetFrameDecorationsForUser(
232 const UserId& user_id, 242 const UserId& user_id,
233 mojom::FrameDecorationValuesPtr* values) override; 243 mojom::FrameDecorationValuesPtr* values) override;
234 244
235 private: 245 private:
236 struct CurrentMoveLoopState; 246 struct CurrentMoveLoopState;
247 struct CurrentDragLoopState;
237 friend class Operation; 248 friend class Operation;
238 249
239 using WindowTreeMap = 250 using WindowTreeMap =
240 std::map<ClientSpecificId, std::unique_ptr<WindowTree>>; 251 std::map<ClientSpecificId, std::unique_ptr<WindowTree>>;
241 using UserActivityMonitorMap = 252 using UserActivityMonitorMap =
242 std::map<UserId, std::unique_ptr<UserActivityMonitor>>; 253 std::map<UserId, std::unique_ptr<UserActivityMonitor>>;
243 using UserClipboardMap = 254 using UserClipboardMap =
244 std::map<UserId, std::unique_ptr<ui::clipboard::ClipboardImpl>>; 255 std::map<UserId, std::unique_ptr<ui::clipboard::ClipboardImpl>>;
245 256
246 struct InFlightWindowManagerChange { 257 struct InFlightWindowManagerChange {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 WindowServerDelegate* delegate_; 350 WindowServerDelegate* delegate_;
340 351
341 // State for rendering into a Surface. 352 // State for rendering into a Surface.
342 scoped_refptr<ui::SurfacesState> surfaces_state_; 353 scoped_refptr<ui::SurfacesState> surfaces_state_;
343 354
344 // ID to use for next WindowTree. 355 // ID to use for next WindowTree.
345 ClientSpecificId next_client_id_; 356 ClientSpecificId next_client_id_;
346 357
347 std::unique_ptr<DisplayManager> display_manager_; 358 std::unique_ptr<DisplayManager> display_manager_;
348 359
360 std::unique_ptr<CurrentDragLoopState> current_drag_loop_;
349 std::unique_ptr<CurrentMoveLoopState> current_move_loop_; 361 std::unique_ptr<CurrentMoveLoopState> current_move_loop_;
350 362
351 // Set of WindowTrees. 363 // Set of WindowTrees.
352 WindowTreeMap tree_map_; 364 WindowTreeMap tree_map_;
353 365
354 // If non-null then we're processing a client operation. The Operation is 366 // If non-null then we're processing a client operation. The Operation is
355 // not owned by us (it's created on the stack by WindowTree). 367 // not owned by us (it's created on the stack by WindowTree).
356 Operation* current_operation_; 368 Operation* current_operation_;
357 369
358 bool in_destructor_; 370 bool in_destructor_;
(...skipping 15 matching lines...) Expand all
374 386
375 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; 387 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_;
376 388
377 DISALLOW_COPY_AND_ASSIGN(WindowServer); 389 DISALLOW_COPY_AND_ASSIGN(WindowServer);
378 }; 390 };
379 391
380 } // namespace ws 392 } // namespace ws
381 } // namespace ui 393 } // namespace ui
382 394
383 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ 395 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698