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

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

Issue 2266603002: mus: Implement interwindow drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Uploaded for a few comments. Created 4 years, 4 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: ui/views/mus/native_widget_mus.h
diff --git a/ui/views/mus/native_widget_mus.h b/ui/views/mus/native_widget_mus.h
index 4f47a751aa6d783dfea8ba8b87825e1aded5a96d..c7fcf7d5bf0056fcca48492b789cdd59ef91bd24 100644
--- a/ui/views/mus/native_widget_mus.h
+++ b/ui/views/mus/native_widget_mus.h
@@ -22,6 +22,7 @@
#include "ui/views/mus/mus_export.h"
#include "ui/views/mus/window_tree_host_mus.h"
#include "ui/views/widget/native_widget_private.h"
+#include "ui/wm/public/drag_drop_delegate.h"
namespace aura {
namespace client {
@@ -51,6 +52,8 @@ class FocusController;
}
namespace views {
+class DropHelper;
+class DropTargetMus;
class WidgetDelegate;
// An implementation of NativeWidget that binds to a ui::Window. Because Aura
@@ -63,6 +66,7 @@ class VIEWS_MUS_EXPORT NativeWidgetMus
: public internal::NativeWidgetPrivate,
public aura::WindowDelegate,
public aura::WindowTreeHostObserver,
+ public aura::client::DragDropDelegate,
public NON_EXPORTED_BASE(ui::InputEventHandler) {
public:
NativeWidgetMus(internal::NativeWidgetDelegate* delegate,
@@ -164,7 +168,7 @@ class VIEWS_MUS_EXPORT NativeWidgetMus
void RunShellDrag(View* view,
const ui::OSExchangeData& data,
const gfx::Point& location,
- int operation,
+ int drag_operations,
ui::DragDropTypes::DragEventSource source) override;
void SchedulePaintInRect(const gfx::Rect& rect) override;
void SetCursor(gfx::NativeCursor cursor) override;
@@ -219,6 +223,12 @@ class VIEWS_MUS_EXPORT NativeWidgetMus
const gfx::Point& new_origin) override;
void OnHostCloseRequested(const aura::WindowTreeHost* host) override;
+ // Overridden from aura::client::DragDropDelegate:
+ void OnDragEntered(const ui::DropTargetEvent& event) override;
+ int OnDragUpdated(const ui::DropTargetEvent& event) override;
+ void OnDragExited() override;
+ int OnPerformDrop(const ui::DropTargetEvent& event) override;
+
// Overridden from ui::InputEventHandler:
void OnWindowInputEvent(
ui::Window* view,
@@ -272,6 +282,9 @@ class VIEWS_MUS_EXPORT NativeWidgetMus
// and this is used to unsafely pass void* pointers around chrome.
std::map<std::string, void*> native_window_properties_;
+ // Receives drop events for |window_|.
+ std::unique_ptr<DropTargetMus> drop_target_;
+
// Aura configuration.
std::unique_ptr<WindowTreeHostMus> window_tree_host_;
aura::Window* content_;
@@ -281,6 +294,9 @@ class VIEWS_MUS_EXPORT NativeWidgetMus
std::unique_ptr<aura::client::ScreenPositionClient> screen_position_client_;
std::unique_ptr<wm::CursorManager> cursor_manager_;
+ std::unique_ptr<DropHelper> drop_helper_;
+ int last_drop_operation_;
+
base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_;
DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus);

Powered by Google App Engine
This is Rietveld 408576698