drag_utils.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) 2012 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. #ifndef UI_VIEWS_DRAG_UTILS_H_
  5. #define UI_VIEWS_DRAG_UTILS_H_
  6. #include <memory>
  7. #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h"
  8. #include "ui/base/dragdrop/os_exchange_data.h"
  9. #include "ui/gfx/native_widget_types.h"
  10. #include "ui/views/views_export.h"
  11. namespace gfx {
  12. class Point;
  13. }
  14. namespace views {
  15. class Widget;
  16. // Starts a drag operation. This blocks until the drag operation completes.
  17. VIEWS_EXPORT void RunShellDrag(gfx::NativeView view,
  18. std::unique_ptr<ui::OSExchangeData> data,
  19. const gfx::Point& location,
  20. int operation,
  21. ui::mojom::DragEventSource source);
  22. // Returns the device scale for the display associated with this |widget|'s
  23. // native view.
  24. VIEWS_EXPORT float ScaleFactorForDragFromWidget(const Widget* widget);
  25. } // namespace views
  26. #endif // UI_VIEWS_DRAG_UTILS_H_