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

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

Issue 2349973010: mus drag and drop: return the completed effect to the caller. (Closed)
Patch Set: Rename some effect_taken to action_taken for consistency. 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
« no previous file with comments | « services/ui/public/interfaces/window_tree.mojom ('k') | services/ui/ws/drag_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_DRAG_CONTROLLER_H_ 5 #ifndef SERVICES_UI_WS_DRAG_CONTROLLER_H_
6 #define SERVICES_UI_WS_DRAG_CONTROLLER_H_ 6 #define SERVICES_UI_WS_DRAG_CONTROLLER_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "services/ui/common/types.h" 9 #include "services/ui/common/types.h"
10 #include "services/ui/ws/ids.h" 10 #include "services/ui/ws/ids.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void OnWillDestroyDragTargetConnection(DragTargetConnection* connection); 45 void OnWillDestroyDragTargetConnection(DragTargetConnection* connection);
46 46
47 private: 47 private:
48 friend class test::DragControllerTestApi; 48 friend class test::DragControllerTestApi;
49 enum class OperationType { NONE, ENTER, OVER, LEAVE, DROP }; 49 enum class OperationType { NONE, ENTER, OVER, LEAVE, DROP };
50 struct Operation; 50 struct Operation;
51 struct WindowState; 51 struct WindowState;
52 52
53 // Notifies all windows we messaged that the drag is finished, and then tell 53 // Notifies all windows we messaged that the drag is finished, and then tell
54 // |source| the result. 54 // |source| the result.
55 void MessageDragCompleted(bool success); 55 void MessageDragCompleted(bool success, uint32_t action_taken);
56 56
57 // Returns the number of events on |window|. A value of 1 means that there's 57 // Returns the number of events on |window|. A value of 1 means that there's
58 // a single event outstanding that we're waiting for a response from the 58 // a single event outstanding that we're waiting for a response from the
59 // client, all values over 1 are queued and will be dispatched when the event 59 // client, all values over 1 are queued and will be dispatched when the event
60 // in the front of the queue gets a response. 60 // in the front of the queue gets a response.
61 size_t GetSizeOfQueueForWindow(ServerWindow* window); 61 size_t GetSizeOfQueueForWindow(ServerWindow* window);
62 62
63 // Sets |current_target_window_| to |current_target|, making sure that we add 63 // Sets |current_target_window_| to |current_target|, making sure that we add
64 // and release ServerWindow observers correctly. 64 // and release ServerWindow observers correctly.
65 void SetCurrentTargetWindow(ServerWindow* current_target); 65 void SetCurrentTargetWindow(ServerWindow* current_target);
66 66
67 // Ensure that |window| has an entry in |window_state_| and that we're an 67 // Ensure that |window| has an entry in |window_state_| and that we're an
68 // observer. 68 // observer.
69 void EnsureWindowObserved(ServerWindow* window); 69 void EnsureWindowObserved(ServerWindow* window);
70 70
71 void QueueOperation(ServerWindow* window, 71 void QueueOperation(ServerWindow* window,
72 OperationType type, 72 OperationType type,
73 uint32_t event_flags, 73 uint32_t event_flags,
74 gfx::Point screen_position); 74 gfx::Point screen_position);
75 void DispatchOperation(ServerWindow* window, WindowState* state); 75 void DispatchOperation(ServerWindow* window, WindowState* state);
76 void OnRespondToOperation(ServerWindow* window); 76 void OnRespondToOperation(ServerWindow* window);
77 77
78 // Callback methods. 78 // Callback methods.
79 void OnDragStatusCompleted(const WindowId& id, uint32_t bitmask); 79 void OnDragStatusCompleted(const WindowId& id, uint32_t bitmask);
80 void OnDragDropCompleted(const WindowId& id, uint32_t bitmask); 80 void OnDragDropCompleted(const WindowId& id, uint32_t action);
81 81
82 // ServerWindowObserver: 82 // ServerWindowObserver:
83 void OnWindowDestroying(ServerWindow* window) override; 83 void OnWindowDestroying(ServerWindow* window) override;
84 84
85 // Our owner. 85 // Our owner.
86 DragSource* source_; 86 DragSource* source_;
87 87
88 // A bit-field of acceptable drag operations offered by the source. 88 // A bit-field of acceptable drag operations offered by the source.
89 const uint32_t drag_operations_; 89 const uint32_t drag_operations_;
90 90
(...skipping 25 matching lines...) Expand all
116 116
117 base::WeakPtrFactory<DragController> weak_factory_; 117 base::WeakPtrFactory<DragController> weak_factory_;
118 118
119 DISALLOW_COPY_AND_ASSIGN(DragController); 119 DISALLOW_COPY_AND_ASSIGN(DragController);
120 }; 120 };
121 121
122 } // namespace ws 122 } // namespace ws
123 } // namespace ui 123 } // namespace ui
124 124
125 #endif // SERVICES_UI_WS_DRAG_CONTROLLER_H_ 125 #endif // SERVICES_UI_WS_DRAG_CONTROLLER_H_
OLDNEW
« no previous file with comments | « services/ui/public/interfaces/window_tree.mojom ('k') | services/ui/ws/drag_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698