OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_VIEWS_COCOA_COCOA_DRAG_DROP_MANAGER_H_ | |
6 #define UI_VIEWS_COCOA_COCOA_DRAG_DROP_MANAGER_H_ | |
7 | |
8 #import <Cocoa/Cocoa.h> | |
9 | |
10 #include <memory> | |
11 #include <vector> | |
12 | |
13 #import "base/mac/scoped_nsobject.h" | |
14 #include "base/macros.h" | |
15 #include "ui/base/dragdrop/drag_drop_types.h" | |
16 #include "ui/views/views_export.h" | |
17 #include "ui/views/widget/drop_helper.h" | |
18 | |
19 @class CocoaDragSourceProvider; | |
20 class DropHelper; | |
21 | |
22 namespace gfx { | |
23 class Point; | |
24 } // namespace gfx | |
25 | |
26 namespace ui { | |
27 class OSExchangeData; | |
28 } // namespace ui | |
29 using ui::OSExchangeData; | |
30 | |
31 namespace views { | |
32 | |
33 class BridgedNativeWidget; | |
34 | |
35 class VIEWS_EXPORT CocoaDragDropManager { | |
tapted
2016/05/11 12:36:15
This class looks a lot like an aura::DragDropClien
spqchan
2016/05/23 21:26:21
Sounds good. I renamed most of my methods accordin
| |
36 public: | |
37 explicit CocoaDragDropManager(BridgedNativeWidget* view); | |
38 ~CocoaDragDropManager(); | |
39 | |
40 void BeginDrag(const ui::OSExchangeData& data, | |
41 const gfx::Point& location, | |
42 int operation, | |
43 ui::DragDropTypes::DragEventSource source); | |
44 | |
45 NSDragOperation DraggingOver(id<NSDraggingInfo>); | |
46 | |
47 NSDragOperation OnDrop(id<NSDraggingInfo> sender); | |
48 | |
49 void EndDrag(); | |
50 | |
51 void SetRootView(View* view); | |
52 | |
53 private: | |
54 gfx::Point LocationInView(NSPoint point) const; | |
55 | |
56 base::scoped_nsobject<CocoaDragSourceProvider> drag_source_; | |
57 std::unique_ptr<DropHelper> drop_helper_; | |
58 | |
59 int operation_; | |
60 BridgedNativeWidget* bridge_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(CocoaDragDropManager); | |
63 }; | |
64 | |
65 } // namespace views | |
66 | |
67 #endif // UI_VIEWS_COCOA_COCOA_DRAG_DROP_MANAGER_H_ | |
OLD | NEW |