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

Unified Diff: app/gtk_dnd_util.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 | « app/gtk_dnd_util.h ('k') | chrome/browser/gtk/tab_contents_drag_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gtk_dnd_util.cc
diff --git a/app/gtk_dnd_util.cc b/app/gtk_dnd_util.cc
index d6b0903be246db6d3b2d1359f722cd4b42da93c1..43c48bd091b2c12a869791825a698f8309ad055a 100644
--- a/app/gtk_dnd_util.cc
+++ b/app/gtk_dnd_util.cc
@@ -11,6 +11,13 @@
static const int kBitsPerByte = 8;
+using WebKit::WebDragOperationsMask;
+using WebKit::WebDragOperation;
+using WebKit::WebDragOperationNone;
+using WebKit::WebDragOperationCopy;
+using WebKit::WebDragOperationLink;
+using WebKit::WebDragOperationMove;
+
namespace {
void AddTargetToList(GtkTargetList* targets, int target_code) {
@@ -226,15 +233,26 @@ bool ExtractURIList(GtkSelectionData* selection_data, std::vector<GURL>* urls) {
return true;
}
-GdkDragAction WebDragOpToGdkDragAction(WebKit::WebDragOperationsMask op) {
+GdkDragAction WebDragOpToGdkDragAction(WebDragOperationsMask op) {
GdkDragAction action = static_cast<GdkDragAction>(0);
- if (op & WebKit::WebDragOperationCopy)
+ if (op & WebDragOperationCopy)
action = static_cast<GdkDragAction>(action | GDK_ACTION_COPY);
- if (op & WebKit::WebDragOperationLink)
+ if (op & WebDragOperationLink)
action = static_cast<GdkDragAction>(action | GDK_ACTION_LINK);
- if (op & WebKit::WebDragOperationMove)
+ if (op & WebDragOperationMove)
action = static_cast<GdkDragAction>(action | GDK_ACTION_MOVE);
return action;
}
+WebDragOperationsMask GdkDragActionToWebDragOp(GdkDragAction action) {
+ WebDragOperationsMask op = WebDragOperationNone;
+ if (action & GDK_ACTION_COPY)
+ op = static_cast<WebDragOperationsMask>(op | WebDragOperationCopy);
+ if (action & GDK_ACTION_LINK)
+ op = static_cast<WebDragOperationsMask>(op | WebDragOperationLink);
+ if (action & GDK_ACTION_MOVE)
+ op = static_cast<WebDragOperationsMask>(op | WebDragOperationMove);
+ return op;
+}
+
} // namespace gtk_dnd_util
« no previous file with comments | « app/gtk_dnd_util.h ('k') | chrome/browser/gtk/tab_contents_drag_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698