summaryrefslogtreecommitdiffstats
path: root/content/browser/web_contents/drag_utils_gtk.cc
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 21:26:37 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 21:26:37 +0000
commitf9e4daec200c22fb09df67bcd7f542a2d52fc9ed (patch)
tree5016666f8a1aea4d60dc911e1bcef4feef167e12 /content/browser/web_contents/drag_utils_gtk.cc
parente5e84e275e9ef65d280d66f2e8ee3ccb666a1cdb (diff)
downloadchromium_src-f9e4daec200c22fb09df67bcd7f542a2d52fc9ed.zip
chromium_src-f9e4daec200c22fb09df67bcd7f542a2d52fc9ed.tar.gz
chromium_src-f9e4daec200c22fb09df67bcd7f542a2d52fc9ed.tar.bz2
TabContents -> WebContentsImpl, part 3.
BUG=105875 TEST=no change Review URL: http://codereview.chromium.org/9960071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/web_contents/drag_utils_gtk.cc')
-rw-r--r--content/browser/web_contents/drag_utils_gtk.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/content/browser/web_contents/drag_utils_gtk.cc b/content/browser/web_contents/drag_utils_gtk.cc
new file mode 100644
index 0000000..8164c53
--- /dev/null
+++ b/content/browser/web_contents/drag_utils_gtk.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 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/web_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