summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 02:38:03 +0000
committerarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 02:38:03 +0000
commit5f9ae6c55bb6cf325bcd85465a370d7fc32bd47a (patch)
treebb9b9e7c5ef78e47dafb968bea5491ca54d2965b /webkit
parent8f04ff93eba6678ed17b7157f805212d9438507b (diff)
downloadchromium_src-5f9ae6c55bb6cf325bcd85465a370d7fc32bd47a.zip
chromium_src-5f9ae6c55bb6cf325bcd85465a370d7fc32bd47a.tar.gz
chromium_src-5f9ae6c55bb6cf325bcd85465a370d7fc32bd47a.tar.bz2
Make the cancelling of drag and drop match Safari for Windows. This is
a follow up CL to http://codereview.chromium.org/149038 as well as to https://bugs.webkit.org/show_bug.cgi?id=26699 With this change we use DragOperationNone (instead of DragOperationCopy) and NoButton (instead of LeftButton) when the user presses Escape. BUG=12018 TEST=On the new new tab page drag one of the thumbnails out of the window and press escape. The thumbnail should move back to its starting position. Review URL: http://codereview.chromium.org/149296 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20125 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webview.h5
-rw-r--r--webkit/glue/webview_impl.cc12
-rw-r--r--webkit/glue/webview_impl.h3
3 files changed, 19 insertions, 1 deletions
diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h
index a2621ab..7468e0a 100644
--- a/webkit/glue/webview.h
+++ b/webkit/glue/webview.h
@@ -171,6 +171,11 @@ class WebView : public WebWidget {
// Show the JavaScript console.
virtual void ShowJavaScriptConsole() = 0;
+ // Notifies the webview that a drag has been cancelled.
+ virtual void DragSourceCancelledAt(
+ const WebKit::WebPoint& client_point,
+ const WebKit::WebPoint& screen_point) = 0;
+
// Notifies the webview that a drag has terminated.
virtual void DragSourceEndedAt(
const WebKit::WebPoint& client_point,
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 45ce865..250896e 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -1537,13 +1537,23 @@ void WebViewImpl::ShowJavaScriptConsole() {
page_->inspectorController()->showPanel(InspectorController::ConsolePanel);
}
-void WebViewImpl::DragSourceEndedAt(
+void WebViewImpl::DragSourceCancelledAt(
const WebPoint& client_point,
const WebPoint& screen_point) {
PlatformMouseEvent pme(webkit_glue::WebPointToIntPoint(client_point),
webkit_glue::WebPointToIntPoint(screen_point),
NoButton, MouseEventMoved, 0, false, false, false,
false, 0);
+ page_->mainFrame()->eventHandler()->dragSourceEndedAt(pme, DragOperationNone);
+}
+
+void WebViewImpl::DragSourceEndedAt(
+ const WebPoint& client_point,
+ const WebPoint& screen_point) {
+ PlatformMouseEvent pme(webkit_glue::WebPointToIntPoint(client_point),
+ webkit_glue::WebPointToIntPoint(screen_point),
+ LeftButton, MouseEventMoved, 0, false, false, false,
+ false, 0);
page_->mainFrame()->eventHandler()->dragSourceEndedAt(pme, DragOperationCopy);
}
diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h
index f5908a5..405d654 100644
--- a/webkit/glue/webview_impl.h
+++ b/webkit/glue/webview_impl.h
@@ -95,6 +95,9 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> {
virtual void CopyImageAt(int x, int y);
virtual void InspectElement(int x, int y);
virtual void ShowJavaScriptConsole();
+ virtual void DragSourceCancelledAt(
+ const WebKit::WebPoint& client_point,
+ const WebKit::WebPoint& screen_point);
virtual void DragSourceEndedAt(
const WebKit::WebPoint& client_point,
const WebKit::WebPoint& screen_point);