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

Unified Diff: content/browser/web_contents/web_drag_source_win.cc

Issue 14122008: Enable touch-initiated drag-drop work on Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixings in drag_source_win Created 7 years, 6 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
« no previous file with comments | « content/browser/web_contents/web_drag_source_win.h ('k') | ui/base/dragdrop/drag_source_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_drag_source_win.cc
diff --git a/content/browser/web_contents/web_drag_source_win.cc b/content/browser/web_contents/web_drag_source_win.cc
index 53df4e81725e0984a3f09e7ec496eb022174095f..d9f2166ada742f14cd68153210e29a19aca9b5a1 100644
--- a/content/browser/web_contents/web_drag_source_win.cc
+++ b/content/browser/web_contents/web_drag_source_win.cc
@@ -6,11 +6,13 @@
#include "base/bind.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_view_win.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/web_contents/web_drag_utils_win.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data.h"
using WebKit::WebDragOperationNone;
@@ -33,8 +35,9 @@ static void GetCursorPositions(gfx::NativeWindow wnd, gfx::Point* client,
// WebDragSource, public:
WebDragSource::WebDragSource(gfx::NativeWindow source_wnd,
- WebContents* web_contents)
- : ui::DragSourceWin(),
+ WebContents* web_contents,
+ ui::DragDropTypes::DragEventSource event_source)
+ : ui::DragSourceWin(event_source),
source_wnd_(source_wnd),
web_contents_(static_cast<WebContentsImpl*>(web_contents)),
effect_(DROPEFFECT_NONE),
@@ -66,6 +69,7 @@ void WebDragSource::OnDragSourceCancel() {
web_contents_->DragSourceEndedAt(client.x(), client.y(),
screen.x(), screen.y(),
WebDragOperationNone);
+ CancelLongPressGestureIfNeeded();
}
void WebDragSource::OnDragSourceDrop() {
@@ -84,12 +88,20 @@ void WebDragSource::OnDragSourceDrop() {
void WebDragSource::DelayedOnDragSourceDrop() {
if (!web_contents_)
return;
-
gfx::Point client;
gfx::Point screen;
GetCursorPositions(source_wnd_, &client, &screen);
web_contents_->DragSourceEndedAt(client.x(), client.y(), screen.x(),
screen.y(), WinDragOpToWebDragOp(effect_));
+ CancelLongPressGestureIfNeeded();
+}
+
+void WebDragSource::CancelLongPressGestureIfNeeded() {
+ RenderWidgetHostViewWin* rwhv =
+ static_cast<RenderWidgetHostViewWin*>(
+ web_contents_->GetRenderWidgetHostView());
+ if (rwhv->in_long_press_gesture())
+ rwhv->CancelLongPressGesture();
}
void WebDragSource::OnDragSourceMove() {
« no previous file with comments | « content/browser/web_contents/web_drag_source_win.h ('k') | ui/base/dragdrop/drag_source_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698