Chromium Code Reviews| 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..a004c885b255e2acc5c2cd504d379fbad8e64242 |
| --- /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 { |
| + |
| +uint32_t ui::DragDropTypes::DragOperationToNSDragOperation(int drag_operation) { |
| + uint32_t ns_drag_operation = NSDragOperationNone; |
|
tapted
2016/05/11 12:36:15
and now it's safe to #include <Cocoa> this can pro
spqchan
2016/05/23 21:26:21
Done.
|
| + |
| + 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 |