summaryrefslogtreecommitdiffstats
path: root/views/view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/view.cc')
-rw-r--r--views/view.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/views/view.cc b/views/view.cc
index 30a6e74..65e642e 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -554,6 +554,20 @@ void View::RemoveAllChildViews(bool delete_views) {
UpdateTooltip();
}
+void View::DoDrag(const MouseEvent& e, int press_x, int press_y) {
+ int drag_operations = GetDragOperations(press_x, press_y);
+ if (drag_operations == DragDropTypes::DRAG_NONE)
+ return;
+
+ OSExchangeData data;
+ WriteDragData(press_x, press_y, &data);
+
+ // Message the RootView to do the drag and drop. That way if we're removed
+ // the RootView can detect it and avoid calling us back.
+ RootView* root_view = GetRootView();
+ root_view->StartDragForViewFromMouseEvent(this, data, drag_operations);
+}
+
void View::DoRemoveChildView(View* a_view,
bool update_focus_cycle,
bool update_tool_tip,