Index: ui/base/dragdrop/drag_source_win.cc |
diff --git a/ui/base/dragdrop/drag_source_win.cc b/ui/base/dragdrop/drag_source_win.cc |
index 90ce68273a3379b463e1d9571d9fc73dbd26ad3f..c86357e2fd291907c46cfc2ff9c10900fdc83e05 100644 |
--- a/ui/base/dragdrop/drag_source_win.cc |
+++ b/ui/base/dragdrop/drag_source_win.cc |
@@ -6,7 +6,14 @@ |
namespace ui { |
-DragSourceWin::DragSourceWin() : cancel_drag_(false) { |
+DragSourceWin::DragSourceWin() |
+ : cancel_drag_(false), |
+ event_source_(DragDropTypes::DRAG_EVENT_SOURCE_MOUSE) { |
+} |
+ |
+DragSourceWin::DragSourceWin(DragDropTypes::DragEventSource event_source) |
+ : cancel_drag_(false), |
+ event_source_(event_source) { |
} |
HRESULT DragSourceWin::QueryContinueDrag(BOOL escape_pressed, DWORD key_state) { |
@@ -18,7 +25,12 @@ HRESULT DragSourceWin::QueryContinueDrag(BOOL escape_pressed, DWORD key_state) { |
return DRAGDROP_S_CANCEL; |
} |
- if (!(key_state & MK_LBUTTON)) { |
+ // On Windows, the touch-initiated drag-drop is driven by mouse right down |
+ // event programmatically. |
+ if ((event_source_ == DragDropTypes::DRAG_EVENT_SOURCE_MOUSE && |
+ !(key_state & MK_LBUTTON)) || |
+ (event_source_ == DragDropTypes::DRAG_EVENT_SOURCE_TOUCH && |
+ !(key_state && MK_RBUTTON))) { |
OnDragSourceDrop(); |
return DRAGDROP_S_DROP; |
} |