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

Unified Diff: services/ui/ws/window_tree.h

Issue 2266603002: mus: Implement interwindow drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more 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
« no previous file with comments | « services/ui/ws/window_server.cc ('k') | services/ui/ws/window_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree.h
diff --git a/services/ui/ws/window_tree.h b/services/ui/ws/window_tree.h
index 2f0f9445598ac00942deb714d87b5bc77c6697d2..cc54eb85536a13dbb9cf40ae9f6345b4161413d5 100644
--- a/services/ui/ws/window_tree.h
+++ b/services/ui/ws/window_tree.h
@@ -21,6 +21,8 @@
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "services/ui/public/interfaces/window_tree.mojom.h"
#include "services/ui/ws/access_policy_delegate.h"
+#include "services/ui/ws/drag_source.h"
+#include "services/ui/ws/drag_target_connection.h"
#include "services/ui/ws/ids.h"
#include "services/ui/ws/user_id.h"
#include "services/ui/ws/window_tree_binding.h"
@@ -40,6 +42,7 @@ namespace ws {
class AccessPolicy;
class DisplayManager;
class Display;
+class DragTargetConnection;
class EventMatcher;
class ServerWindow;
class TargetedEvent;
@@ -63,7 +66,9 @@ class WindowTreeTestApi;
// See ids.h for details on how WindowTree handles identity of windows.
class WindowTree : public mojom::WindowTree,
public AccessPolicyDelegate,
- public mojom::WindowManagerClient {
+ public mojom::WindowManagerClient,
+ public DragSource,
+ public DragTargetConnection {
public:
WindowTree(WindowServer* window_server,
const UserId& user_id,
@@ -418,6 +423,7 @@ class WindowTree : public mojom::WindowTree,
Id transport_window_id,
const gfx::Insets& insets,
mojo::Array<gfx::Rect> transport_additional_client_areas) override;
+ void SetCanAcceptDrops(Id window_id, bool accepts_drops) override;
void SetHitTestMask(Id transport_window_id,
const base::Optional<gfx::Rect>& mask) override;
void GetWindowManagerClient(
@@ -425,6 +431,11 @@ class WindowTree : public mojom::WindowTree,
override;
void GetCursorLocationMemory(const GetCursorLocationMemoryCallback& callback)
override;
+ void PerformDragDrop(uint32_t change_id,
+ Id source_window_id,
+ int32_t drag_pointer,
+ mojo::Map<mojo::String, mojo::Array<uint8_t>> drag_data,
+ uint32_t drag_operation) override;
void PerformWindowMove(uint32_t change_id,
Id window_id,
ui::mojom::MoveLoopSource source,
@@ -460,6 +471,36 @@ class WindowTree : public mojom::WindowTree,
bool IsWindowRootOfAnotherTreeForAccessPolicy(
const ServerWindow* window) const override;
+ // DragSource:
+ void OnDragCompleted(bool success) override;
+ ServerWindow* GetWindowById(const WindowId& id) override;
+ DragTargetConnection* GetDragTargetForWindow(
+ const ServerWindow* window) override;
+
+ // DragTargetConnection:
+ void PerformOnDragDropStart(
+ mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data) override;
+ void PerformOnDragEnter(
+ const ServerWindow* window,
+ uint32_t event_flags,
+ const gfx::Point& cursor_offset,
+ uint32_t effect_bitmask,
+ const base::Callback<void(uint32_t)>& callback) override;
+ void PerformOnDragOver(
+ const ServerWindow* window,
+ uint32_t event_flags,
+ const gfx::Point& cursor_offset,
+ uint32_t effect_bitmask,
+ const base::Callback<void(uint32_t)>& callback) override;
+ void PerformOnDragLeave(const ServerWindow* window) override;
+ void PerformOnCompleteDrop(
+ const ServerWindow* window,
+ uint32_t event_flags,
+ const gfx::Point& cursor_offset,
+ uint32_t effect_bitmask,
+ const base::Callback<void(uint32_t)>& callback) override;
+ void PerformOnDragDropDone() override;
+
WindowServer* window_server_;
UserId user_id_;
« no previous file with comments | « services/ui/ws/window_server.cc ('k') | services/ui/ws/window_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698