From f67e53d038a78f0ca1bc1ccdbfecfbcddfc2f816 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 14 Feb 2014 17:56:19 +0100 Subject: Avoid locking up the web view when starting a drag We currently don't have an implementation for drag and drop and we need to explicitly call SystemDragEnded to avoid leaving the render process in an inconsisten state. See http://crbug.com/157134 Change-Id: I52220602d4e4832d11ef601589a588c91bb81285 Reviewed-by: Andras Becsi --- src/core/web_contents_view_qt.cpp | 11 +++++++++++ src/core/web_contents_view_qt.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index 8fdcf4679..2ab5b483c 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -131,6 +131,17 @@ void WebContentsViewQt::ShowContextMenu(const content::ContextMenuParams ¶ms m_client->contextMenuRequested(contextMenuData); } +void WebContentsViewQt::StartDragging(const content::DropData& drop_data, WebKit::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const content::DragEventSourceInfo& event_info) +{ + Q_UNUSED(drop_data); + Q_UNUSED(allowed_ops); + Q_UNUSED(image); + Q_UNUSED(image_offset); + Q_UNUSED(event_info); + // Tell the renderer to cancel the drag, see StartDragging's declaration in render_view_host_delegate_view.h for info. + m_webContents->SystemDragEnded(); +} + void WebContentsViewQt::TakeFocus(bool reverse) { m_client->passOnFocus(reverse); diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h index 1c9da487b..63e240b99 100644 --- a/src/core/web_contents_view_qt.h +++ b/src/core/web_contents_view_qt.h @@ -110,6 +110,8 @@ public: virtual void ShowPopupMenu(const gfx::Rect& bounds, int item_height, double item_font_size, int selected_item, const std::vector& items, bool right_aligned, bool allow_multiple_selection) Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED } + virtual void StartDragging(const content::DropData& drop_data, WebKit::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const content::DragEventSourceInfo& event_info) Q_DECL_OVERRIDE; + virtual void ShowContextMenu(const content::ContextMenuParams ¶ms) Q_DECL_OVERRIDE; virtual void TakeFocus(bool reverse) Q_DECL_OVERRIDE; -- cgit v1.2.3