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

Unified Diff: chrome/browser/tab_contents/web_drag_dest_gtk.cc

Issue 1589015: GTK plumbing for dragend. (Closed)
Patch Set: Created 10 years, 9 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 | « chrome/browser/gtk/tab_contents_drag_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/web_drag_dest_gtk.cc
diff --git a/chrome/browser/tab_contents/web_drag_dest_gtk.cc b/chrome/browser/tab_contents/web_drag_dest_gtk.cc
index 1d7cd883499a4caa833692b7802739f34c33c20b..0fd6caa0442186a43f03b97521761f22887c58ad 100644
--- a/chrome/browser/tab_contents/web_drag_dest_gtk.cc
+++ b/chrome/browser/tab_contents/web_drag_dest_gtk.cc
@@ -17,24 +17,6 @@
using WebKit::WebDragOperation;
using WebKit::WebDragOperationNone;
-using WebKit::WebDragOperationCopy;
-using WebKit::WebDragOperationLink;
-using WebKit::WebDragOperationMove;
-
-namespace {
-
-WebDragOperation GdkDragActionToWebDragOp(GdkDragAction action) {
- WebDragOperation op = WebDragOperationNone;
- if (action & GDK_ACTION_COPY)
- op = static_cast<WebDragOperation>(op | WebDragOperationCopy);
- if (action & GDK_ACTION_LINK)
- op = static_cast<WebDragOperation>(op | WebDragOperationLink);
- if (action & GDK_ACTION_MOVE)
- op = static_cast<WebDragOperation>(op | WebDragOperationMove);
- return op;
-}
-
-} // namespace
WebDragDestGtk::WebDragDestGtk(TabContents* tab_contents, GtkWidget* widget)
: tab_contents_(tab_contents),
@@ -110,11 +92,11 @@ gboolean WebDragDestGtk::OnDragMotion(GtkWidget* sender,
time);
}
} else if (data_requests_ == 0) {
- // TODO(snej): Pass appropriate DragOperation instead of hardcoding
tab_contents_->render_view_host()->
- DragTargetDragOver(gtk_util::ClientPoint(widget_),
- gtk_util::ScreenPoint(widget_),
- GdkDragActionToWebDragOp(context->actions));
+ DragTargetDragOver(
+ gtk_util::ClientPoint(widget_),
+ gtk_util::ScreenPoint(widget_),
+ gtk_dnd_util::GdkDragActionToWebDragOp(context->actions));
if (tab_contents_->GetBookmarkDragDelegate())
tab_contents_->GetBookmarkDragDelegate()->OnDragOver(bookmark_drag_data_);
drag_over_time_ = time;
@@ -199,12 +181,11 @@ void WebDragDestGtk::OnDragDataReceived(
if (data_requests_ == 0) {
// Tell the renderer about the drag.
// |x| and |y| are seemingly arbitrary at this point.
- // TODO(snej): Pass appropriate DragOperation instead of hardcoding.
tab_contents_->render_view_host()->
DragTargetDragEnter(*drop_data_.get(),
gtk_util::ClientPoint(widget_),
gtk_util::ScreenPoint(widget_),
- GdkDragActionToWebDragOp(context->actions));
+ gtk_dnd_util::GdkDragActionToWebDragOp(context->actions));
// This is non-null if tab_contents_ is showing an ExtensionDOMUI with
// support for (at the moment experimental) drag and drop extensions.
« no previous file with comments | « chrome/browser/gtk/tab_contents_drag_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698