drag_drop_client.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2018 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 COMPONENTS_REMOTE_COCOA_APP_SHIM_DRAG_DROP_CLIENT_H_
  5. #define COMPONENTS_REMOTE_COCOA_APP_SHIM_DRAG_DROP_CLIENT_H_
  6. #import <Cocoa/Cocoa.h>
  7. #include "components/remote_cocoa/app_shim/remote_cocoa_app_shim_export.h"
  8. namespace remote_cocoa {
  9. // Interface between the content view of a NativeWidgetNSWindowBridge and a
  10. // DragDropClientMac in the browser process. This interface should eventually
  11. // become mojo-ified, but at the moment only passes raw pointers (consequently,
  12. // drag-drop behavior does not work in RemoteMacViews).
  13. class REMOTE_COCOA_APP_SHIM_EXPORT DragDropClient {
  14. public:
  15. virtual ~DragDropClient() {}
  16. // Called when mouse is dragged during a drag and drop.
  17. virtual NSDragOperation DragUpdate(id<NSDraggingInfo>) = 0;
  18. // Called when mouse is released during a drag and drop.
  19. virtual NSDragOperation Drop(id<NSDraggingInfo> sender) = 0;
  20. // Called when the drag and drop session has ended.
  21. virtual void EndDrag() = 0;
  22. // Called when mouse leaves the drop area.
  23. virtual void DragExit() = 0;
  24. };
  25. } // namespace remote_cocoa
  26. #endif // COMPONENTS_REMOTE_COCOA_APP_SHIM_DRAG_DROP_CLIENT_H_