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

Unified Diff: ui/views/mus/drag_drop_client_mus.h

Issue 2323553002: mash: Use the new mus drag and drop API to get drag working in mash. (Closed)
Patch Set: 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 | « ui/views/mus/BUILD.gn ('k') | ui/views/mus/drag_drop_client_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/drag_drop_client_mus.h
diff --git a/ui/views/mus/drag_drop_client_mus.h b/ui/views/mus/drag_drop_client_mus.h
new file mode 100644
index 0000000000000000000000000000000000000000..bb0b2954591060644a19cae104f848190d168879
--- /dev/null
+++ b/ui/views/mus/drag_drop_client_mus.h
@@ -0,0 +1,59 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_MUS_DRAG_DROP_CLIENT_MUS_H_
+#define UI_VIEWS_MUS_DRAG_DROP_CLIENT_MUS_H_
+
+#include "base/callback.h"
+#include "ui/base/dragdrop/drag_drop_types.h"
+#include "ui/wm/public/drag_drop_client.h"
+
+namespace aura {
+class Window;
+}
+
+namespace ui {
+class LocatedEvent;
+class OSExchangeData;
+class Window;
+}
+
+namespace views {
+
+// An aura client object that translates aura dragging methods to their
+// remote ui::Window equivalents.
+class DragDropClientMus : public aura::client::DragDropClient {
+ public:
+ DragDropClientMus(ui::Window* ui_window);
+ ~DragDropClientMus() override;
+
+ // Overridden from aura::client::DragDropClient:
+ int StartDragAndDrop(const ui::OSExchangeData& data,
+ aura::Window* root_window,
+ aura::Window* source_window,
+ const gfx::Point& screen_location,
+ int drag_operations,
+ ui::DragDropTypes::DragEventSource source) override;
+ void DragUpdate(aura::Window* target, const ui::LocatedEvent& event) override;
+ void Drop(aura::Window* target, const ui::LocatedEvent& event) override;
+ void DragCancel() override;
+ bool IsDragDropInProgress() override;
+
+ private:
+ // Callback for StartDragAndDrop().
+ void OnMoveLoopEnd(bool* out_success,
+ uint32_t* out_action,
+ bool in_success,
+ uint32_t in_action);
+
+ ui::Window* ui_window_;
+
+ base::Closure runloop_quit_closure_;
+
+ DISALLOW_COPY_AND_ASSIGN(DragDropClientMus);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_MUS_DRAG_DROP_CLIENT_MUS_H_
« no previous file with comments | « ui/views/mus/BUILD.gn ('k') | ui/views/mus/drag_drop_client_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698