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

Unified Diff: content/browser/tab_contents/drag_utils_gtk.cc

Issue 8196001: content: Split web_drag_dest_gtk.cc into chrome/ and content/ parts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix viewgtk compile Created 9 years, 2 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 | « content/browser/tab_contents/drag_utils_gtk.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/drag_utils_gtk.cc
diff --git a/content/browser/tab_contents/drag_utils_gtk.cc b/content/browser/tab_contents/drag_utils_gtk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b1761b198fb70aa39f15b9fbc0cbeb1cf2e9572c
--- /dev/null
+++ b/content/browser/tab_contents/drag_utils_gtk.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/tab_contents/drag_utils_gtk.h"
+
+using WebKit::WebDragOperationsMask;
+using WebKit::WebDragOperation;
+using WebKit::WebDragOperationNone;
+using WebKit::WebDragOperationCopy;
+using WebKit::WebDragOperationLink;
+using WebKit::WebDragOperationMove;
+
+namespace content {
+
+GdkDragAction WebDragOpToGdkDragAction(WebDragOperationsMask op) {
+ GdkDragAction action = static_cast<GdkDragAction>(0);
+ if (op & WebDragOperationCopy)
+ action = static_cast<GdkDragAction>(action | GDK_ACTION_COPY);
+ if (op & WebDragOperationLink)
+ action = static_cast<GdkDragAction>(action | GDK_ACTION_LINK);
+ 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 content
« no previous file with comments | « content/browser/tab_contents/drag_utils_gtk.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698