Home | History | Annotate | Download | only in dragdrop
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "ui/base/dragdrop/drag_drop_types.h"
      6 
      7 #include <oleidl.h>
      8 
      9 namespace ui {
     10 
     11 int ui::DragDropTypes::DropEffectToDragOperation(
     12     uint32 effect) {
     13   int drag_operation = DRAG_NONE;
     14   if (effect & DROPEFFECT_LINK)
     15     drag_operation |= DRAG_LINK;
     16   if (effect & DROPEFFECT_COPY)
     17     drag_operation |= DRAG_COPY;
     18   if (effect & DROPEFFECT_MOVE)
     19     drag_operation |= DRAG_MOVE;
     20   return drag_operation;
     21 }
     22 
     23 uint32 ui::DragDropTypes::DragOperationToDropEffect(int drag_operation) {
     24   uint32 drop_effect = DROPEFFECT_NONE;
     25   if (drag_operation & DRAG_LINK)
     26     drop_effect |= DROPEFFECT_LINK;
     27   if (drag_operation & DRAG_COPY)
     28     drop_effect |= DROPEFFECT_COPY;
     29   if (drag_operation & DRAG_MOVE)
     30     drop_effect |= DROPEFFECT_MOVE;
     31   return drop_effect;
     32 }
     33 
     34 }  // namespace ui
     35