Index: chrome/browser/views/tab_contents/tab_contents_drag_win.cc |
diff --git a/chrome/browser/views/tab_contents/tab_contents_drag_win.cc b/chrome/browser/views/tab_contents/tab_contents_drag_win.cc |
index 59ddfd300acf8b4c4c5bea4730e057252778d53f..03497c84bccbc9317074fa171ead2c58ede84056 100644 |
--- a/chrome/browser/views/tab_contents/tab_contents_drag_win.cc |
+++ b/chrome/browser/views/tab_contents/tab_contents_drag_win.cc |
@@ -26,6 +26,9 @@ |
#include "webkit/glue/webdropdata.h" |
using WebKit::WebDragOperationsMask; |
+using WebKit::WebDragOperationCopy; |
+using WebKit::WebDragOperationLink; |
+using WebKit::WebDragOperationMove; |
namespace { |
@@ -58,6 +61,17 @@ LRESULT CALLBACK MsgFilterProc(int code, WPARAM wparam, LPARAM lparam) { |
return CallNextHookEx(msg_hook, code, wparam, lparam); |
} |
+DWORD WebDragOpToWinDragOp(WebDragOperationsMask op) { |
+ DWORD win_op = DROPEFFECT_NONE; |
+ if (op & WebDragOperationCopy) |
+ win_op |= DROPEFFECT_COPY; |
+ if (op & WebDragOperationLink) |
+ win_op |= DROPEFFECT_LINK; |
+ if (op & WebDragOperationMove) |
+ win_op |= DROPEFFECT_MOVE; |
+ return win_op; |
+} |
+ |
} // namespace |
class DragDropThread : public base::Thread { |
@@ -287,8 +301,7 @@ void TabContentsDragWin::DoDragging(const WebDropData& drop_data, |
bool old_state = MessageLoop::current()->NestableTasksAllowed(); |
MessageLoop::current()->SetNestableTasksAllowed(true); |
DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source_, |
- DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); |
- // TODO(snej): Use 'ops' param instead of hardcoding dropeffects |
+ WebDragOpToWinDragOp(ops), &effects); |
MessageLoop::current()->SetNestableTasksAllowed(old_state); |
} |