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

Unified Diff: ui/base/dragdrop/drag_drop_types_mac.mm

Issue 1964283002: MacViews: Implemented Drag & Drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot to add the test Created 4 years, 7 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
Index: ui/base/dragdrop/drag_drop_types_mac.mm
diff --git a/ui/base/dragdrop/drag_drop_types_mac.mm b/ui/base/dragdrop/drag_drop_types_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..0c1d340c52150e40e4d0f503f531d066da7f77e6
--- /dev/null
+++ b/ui/base/dragdrop/drag_drop_types_mac.mm
@@ -0,0 +1,24 @@
+// Copyright 2016 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 "ui/base/dragdrop/drag_drop_types.h"
+
+#import <Cocoa/Cocoa.h>
+
+namespace ui {
+
+uint64_t ui::DragDropTypes::DragOperationToNSDragOperation(int drag_operation) {
+ NSUInteger ns_drag_operation = NSDragOperationNone;
+
+ if (drag_operation & DRAG_LINK)
+ ns_drag_operation |= NSDragOperationLink;
+ if (drag_operation & DRAG_COPY)
+ ns_drag_operation |= NSDragOperationCopy;
+ if (drag_operation & DRAG_MOVE)
+ ns_drag_operation |= NSDragOperationMove;
+
+ return ns_drag_operation;
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698