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

Unified Diff: chrome/browser/views/tab_contents/tab_contents_drag_win.cc

Issue 1132003: Hook up HTML5 effectAllowed and dragEffect on Windows. (Closed)
Patch Set: Created 10 years, 9 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: 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);
}
« no previous file with comments | « chrome/browser/tab_contents/web_drop_target_win.cc ('k') | chrome/browser/views/tab_contents/tab_contents_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698