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

Unified Diff: ui/base/dragdrop/drag_source_win.cc

Issue 14122008: Enable touch-initiated drag-drop work on Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: hot fixing Created 7 years, 7 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/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..756aed75b37634e25056d9f6e36106e4531f079a 100644
--- a/ui/base/dragdrop/drag_source_win.cc
+++ b/ui/base/dragdrop/drag_source_win.cc
@@ -6,7 +6,13 @@
namespace ui {
-DragSourceWin::DragSourceWin() : cancel_drag_(false) {
+DragSourceWin::DragSourceWin()
dcheng 2013/05/28 20:34:02 Nit: do we need this or can we just force all loca
Hongbo Min 2013/05/29 06:08:04 I prefer to reserve it since it is unnecessary to
+ : 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 +24,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;
}
« content/browser/web_contents/web_drag_source_win.h ('K') | « ui/base/dragdrop/drag_source_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698