summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/web_drag_source.cc
diff options
context:
space:
mode:
authorsnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 17:29:25 +0000
committersnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 17:29:25 +0000
commit1d9f4137eff50f1305e288767bb770151526552d (patch)
tree4ae1750d34778e7b0ae23dfe315118cf124c3715 /chrome/browser/tab_contents/web_drag_source.cc
parentc7f475ed4a9fd8f198468df696c55e1c75d65526 (diff)
downloadchromium_src-1d9f4137eff50f1305e288767bb770151526552d.zip
chromium_src-1d9f4137eff50f1305e288767bb770151526552d.tar.gz
chromium_src-1d9f4137eff50f1305e288767bb770151526552d.tar.bz2
Plumb the DragOperation through all the layers between the platform Drag-n-drop code and WebCore.
This allows the HTML5 DataTransfer effectAllowed and dropEffect properties to be set correctly in JS handlers, as per the HTML5 spec. (The drag-dropeffect test isn't in WebKit yet -- it's part of a separate WebKit patch that's been in review for weeks.) R=darin,pink BUG=http://code.google.com/p/chromium/issues/detail?id=14654, http://code.google.com/p/chromium/issues/detail?id=20985 TEST=LayoutTests/fast/events/drag-dropeffect.html, LayoutTests/editing/pasteboard/files-during-page-drags.html Review URL: http://codereview.chromium.org/174364 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/web_drag_source.cc')
-rw-r--r--chrome/browser/tab_contents/web_drag_source.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/tab_contents/web_drag_source.cc b/chrome/browser/tab_contents/web_drag_source.cc
index 9cfbb2d..6f6b243 100644
--- a/chrome/browser/tab_contents/web_drag_source.cc
+++ b/chrome/browser/tab_contents/web_drag_source.cc
@@ -15,6 +15,9 @@
#include "chrome/common/notification_type.h"
#include "chrome/common/notification_service.h"
+using WebKit::WebDragOperationNone;
+using WebKit::WebDragOperationCopy;
+
namespace {
static void GetCursorPositions(gfx::NativeWindow wnd, gfx::Point* client,
@@ -53,8 +56,9 @@ void WebDragSource::OnDragSourceCancel() {
gfx::Point client;
gfx::Point screen;
GetCursorPositions(source_wnd_, &client, &screen);
- render_view_host_->DragSourceCancelledAt(client.x(), client.y(),
- screen.x(), screen.y());
+ render_view_host_->DragSourceEndedAt(client.x(), client.y(),
+ screen.x(), screen.y(),
+ WebDragOperationNone);
}
void WebDragSource::OnDragSourceDrop() {
@@ -65,7 +69,9 @@ void WebDragSource::OnDragSourceDrop() {
gfx::Point screen;
GetCursorPositions(source_wnd_, &client, &screen);
render_view_host_->DragSourceEndedAt(client.x(), client.y(),
- screen.x(), screen.y());
+ screen.x(), screen.y(),
+ WebDragOperationCopy);
+ // TODO(jpa): This needs to be fixed to send the actual drag operation.
}
void WebDragSource::OnDragSourceMove() {