summaryrefslogtreecommitdiffstats
path: root/app/gtk_dnd_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'app/gtk_dnd_util.cc')
-rw-r--r--app/gtk_dnd_util.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/gtk_dnd_util.cc b/app/gtk_dnd_util.cc
index 4d8694d..d6b0903 100644
--- a/app/gtk_dnd_util.cc
+++ b/app/gtk_dnd_util.cc
@@ -226,4 +226,15 @@ bool ExtractURIList(GtkSelectionData* selection_data, std::vector<GURL>* urls) {
return true;
}
+GdkDragAction WebDragOpToGdkDragAction(WebKit::WebDragOperationsMask op) {
+ GdkDragAction action = static_cast<GdkDragAction>(0);
+ if (op & WebKit::WebDragOperationCopy)
+ action = static_cast<GdkDragAction>(action | GDK_ACTION_COPY);
+ if (op & WebKit::WebDragOperationLink)
+ action = static_cast<GdkDragAction>(action | GDK_ACTION_LINK);
+ if (op & WebKit::WebDragOperationMove)
+ action = static_cast<GdkDragAction>(action | GDK_ACTION_MOVE);
+ return action;
+}
+
} // namespace gtk_dnd_util