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

Unified Diff: services/ui/public/cpp/window.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 side-by-side diff with in-line comments
Download patch
Index: services/ui/public/cpp/window.h
diff --git a/services/ui/public/cpp/window.h b/services/ui/public/cpp/window.h
index fc5efd9eb419511e94ebba6c6767a080399af3c9..955902d090b984d14eb09c1c673b7c3aaad5c2f6 100644
--- a/services/ui/public/cpp/window.h
+++ b/services/ui/public/cpp/window.h
@@ -30,6 +30,7 @@ class ServiceProviderImpl;
class WindowObserver;
class WindowSurface;
class WindowSurfaceBinding;
+class WindowDropTarget;
class WindowTreeClient;
class WindowTreeClientPrivate;
@@ -209,6 +210,11 @@ class Window {
bool HasFocus() const;
void SetCanFocus(bool can_focus);
+ // Sets whether this window accepts drags. Passing a non-null |drop_target|
+ // will enable acceptance of drops. Passing null will disable it.
+ void SetCanAcceptDrops(WindowDropTarget* drop_target);
+ WindowDropTarget* drop_target() const { return drop_target_; }
sky 2016/09/13 18:15:31 Either return const here, or remove const from sig
+
// Sets whether this window accepts events.
void SetCanAcceptEvents(bool can_accept_events);
@@ -225,6 +231,15 @@ class Window {
// to a better place.
void RequestClose();
+ // Starts an inter-process drag and drop operation.
+ void PerformDragDrop(
+ int drag_pointer,
+ const std::map<std::string, std::vector<uint8_t>>& drag_data,
+ int drag_operation,
+ const gfx::Point& cursor_location,
+ const SkBitmap& bitmap,
+ const base::Callback<void(bool)>& callback);
+
// Tells the window manager to take control of moving the window. Returns
// true if the move wasn't canceled.
void PerformWindowMove(mojom::MoveLoopSource source,
@@ -342,6 +357,10 @@ class Window {
float opacity_;
int64_t display_id_;
+ // The client supplied delegate that receives drag events for this
+ // window (weak ptr).
+ WindowDropTarget* drop_target_ = nullptr;
+
// Whether this window can accept events. Initialized to true to
// match ServerWindow.
bool can_accept_events_ = true;

Powered by Google App Engine
This is Rietveld 408576698