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 |