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

Side by Side Diff: services/ui/public/cpp/window_drop_target.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
(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 SERVICES_UI_PUBLIC_CPP_WINDOW_DROP_TARGET_H_
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_DROP_TARGET_H_
7
8 #include <map>
9 #include <vector>
10
11 #include "ui/gfx/geometry/point.h"
12
13 namespace ui {
14
15 // Interface that clients that want to opt-in to receiving drag drop events
16 // pass to their ui::Window. This is the client side equivalent to the
17 // messages defined in ui::mojom::WindowTreeClient.
18 class WindowDropTarget {
19 public:
20 virtual ~WindowDropTarget() {}
sky 2016/09/13 18:15:31 move to protected section?
21
22 // On the first time the pointer enters the associated ui::Window, we get a
23 // start message with all the data that's part of the drag. (The source
24 // ui::Window receives this immediately through the client library instead
25 // of asynchronously.)
26 virtual void OnDragStart(
27 std::map<std::string, std::vector<uint8_t>> mime_data) = 0;
28
29 // Each time the pointer enters the associated ui::Window, we receive an
30 // enter event and return a bitmask of drop operations that can be performed
31 // at this location, in terms of the ui::mojom::kDropEffect{None,Move,
32 // Copy,Link} constants.
33 virtual uint32_t OnDragEnter(uint32_t event_flags,
34 const gfx::Point& position,
35 uint32_t effect_bitmask) = 0;
36
37 // Each time the pointer moves inside the associated ui::Window, we receive
38 // an over event and return a bitmask of drop oeprations.
39 virtual uint32_t OnDragOver(uint32_t event_flags,
40 const gfx::Point& position,
41 uint32_t effect_bitmask) = 0;
42
43 // Each time the pointer leaves the associated ui::Window, we receive a
44 // leave event.
45 virtual void OnDragLeave() = 0;
46
47 // If the user releases the pointer over the associated ui::Window, we
48 // receive this drop event to actually try to perform the drop. Unlike the
49 // other methods in this class which return a value, this return value is not
50 // a bitmask and is the operation which was actually completed. Returning 0
51 // indicates that the drag failed and shouldn't be reported as a success.
52 virtual uint32_t OnCompleteDrop(uint32_t event_flags,
53 const gfx::Point& position,
54 uint32_t effect_bitmask) = 0;
55
56 // When a drag that entered the associated window finishes one way or
57 // another, the target receives this message to clear the mime_data from the
58 // start message, along with any other client specific caches.
59 virtual void OnDragFinish() = 0;
60 };
61
62 } // namespace ui
63
64 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_DROP_TARGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698