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

Unified Diff: ui/aura/window_drag_drop_delegate.h

Issue 8450018: First shot at implementing drag&drop for Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 9 years, 1 month 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/aura/window_drag_drop_delegate.h
diff --git a/ui/aura/window_drag_drop_delegate.h b/ui/aura/window_drag_drop_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..63f5064d03a34810f4b7366004ecb839c5d70797
--- /dev/null
+++ b/ui/aura/window_drag_drop_delegate.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2011 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_AURA_WINDOW_DRAG_DROP_DELEGATE_H_
Ben Goodger (Google) 2011/11/16 00:13:20 this should live in client too.
varunjain 2011/11/16 20:30:15 Done.
+#define UI_AURA_WINDOW_DRAG_DROP_DELEGATE_H_
+#pragma once
+
+#include "ui/aura/aura_export.h"
+
+namespace aura {
+
+class DropTargetEvent;
+
+// Delegate interface for drag and drop actions on aura::Window.
+class AURA_EXPORT WindowDragDropDelegate {
+ public:
+ // A window that supports drag and drop must override this and return true if
+ // data contains a type that may be dropped on this window.
+ virtual bool CanDrop(const DropTargetEvent& event) = 0;
+
+ // OnDragEntered is invoked when the mouse enters this window during a drag &
+ // drop session and CanDrop returns true. This is immediately
+ // followed by an invocation of OnDragUpdated, and eventually one of
+ // OnDragExited or OnPerformDrop.
+ virtual void OnDragEntered(const DropTargetEvent& event) = 0;
+
+ // Invoked during a drag and drop session while the mouse is over the window.
+ // This should return a bitmask of the DragDropTypes::DragOperation supported
+ // based on the location of the event. Return 0 to indicate the drop should
+ // not be accepted.
+ virtual int OnDragUpdated(const DropTargetEvent& event) = 0;
+
+ // Invoked during a drag and drop session when the mouse exits the window, or
+ // when the drag session was canceled and the mouse was over the window.
+ virtual void OnDragExited() = 0;
+
+ // Invoked during a drag and drop session when OnDragUpdated returns a valid
+ // operation and the user release the mouse.
+ virtual int OnPerformDrop(const DropTargetEvent& event) = 0;
+
+ protected:
+ virtual ~WindowDragDropDelegate() {}
+};
+
+} // namespace aura
+
+#endif // UI_AURA_WINDOW_DRAG_DROP_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698