summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/render_view_host.cc8
-rw-r--r--content/browser/renderer_host/render_view_host.h1
-rw-r--r--content/common/drag_messages.h3
-rw-r--r--content/common/notification_type.h5
-rw-r--r--content/renderer/render_view.cc2
5 files changed, 19 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index 5030cc6..2701853 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -684,6 +684,7 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
OnMsgRunBeforeUnloadConfirm)
IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging)
IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
+ IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK)
IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole)
IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK)
@@ -1048,6 +1049,13 @@ void RenderViewHost::OnUpdateDragCursor(WebDragOperation current_op) {
view->UpdateDragCursor(current_op);
}
+void RenderViewHost::OnTargetDropACK() {
+ NotificationService::current()->Notify(
+ NotificationType::RENDER_VIEW_HOST_DID_RECEIVE_DRAG_TARGET_DROP_ACK,
+ Source<RenderViewHost>(this),
+ NotificationService::NoDetails());
+}
+
void RenderViewHost::OnTakeFocus(bool reverse) {
RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
if (view)
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h
index 3420536..c4dae8a 100644
--- a/content/browser/renderer_host/render_view_host.h
+++ b/content/browser/renderer_host/render_view_host.h
@@ -438,6 +438,7 @@ class RenderViewHost : public RenderWidgetHost {
const SkBitmap& image,
const gfx::Point& image_offset);
void OnUpdateDragCursor(WebKit::WebDragOperation drag_operation);
+ void OnTargetDropACK();
void OnTakeFocus(bool reverse);
void OnAddMessageToConsole(int32 level,
const std::wstring& message,
diff --git a/content/common/drag_messages.h b/content/common/drag_messages.h
index 6e0507b..a8ac21f 100644
--- a/content/common/drag_messages.h
+++ b/content/common/drag_messages.h
@@ -75,3 +75,6 @@ IPC_MESSAGE_ROUTED4(DragHostMsg_StartDragging,
// |is_drop_target| is true if the mouse is over a valid drop target.
IPC_MESSAGE_ROUTED1(DragHostMsg_UpdateDragCursor,
WebKit::WebDragOperation /* drag_operation */)
+
+// Notifies the host that the renderer finished a drop operation.
+IPC_MESSAGE_ROUTED0(DragHostMsg_TargetDrop_ACK)
diff --git a/content/common/notification_type.h b/content/common/notification_type.h
index 93a5513..418df4e 100644
--- a/content/common/notification_type.h
+++ b/content/common/notification_type.h
@@ -482,6 +482,11 @@ class NotificationType {
// initiated by window.close().
RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW,
+ // This notifies the observer that the drag operation ack in a drag and
+ // drop operation was received. The source is the RenderViewHost.
+ // Note: Used only in testing.
+ RENDER_VIEW_HOST_DID_RECEIVE_DRAG_TARGET_DROP_ACK,
+
// Indicates a RenderWidgetHost has been hidden or restored. The source is
// the RWH whose visibility changed, the details is a bool set to true if
// the new state is "visible."
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index b183d3f..677c1ca 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -3357,6 +3357,8 @@ void RenderView::OnDragTargetDragLeave() {
void RenderView::OnDragTargetDrop(const gfx::Point& client_point,
const gfx::Point& screen_point) {
webview()->dragTargetDrop(client_point, screen_point);
+
+ Send(new DragHostMsg_TargetDrop_ACK(routing_id_));
}
void RenderView::OnDragSourceEndedOrMoved(const gfx::Point& client_point,