wm_move_loop_handler.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2020 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_PLATFORM_WINDOW_WM_WM_MOVE_LOOP_HANDLER_H_
  5. #define UI_PLATFORM_WINDOW_WM_WM_MOVE_LOOP_HANDLER_H_
  6. #include "base/component_export.h"
  7. namespace gfx {
  8. class Vector2d;
  9. }
  10. namespace ui {
  11. class PlatformWindow;
  12. // Handler that starts interactive move loop for the PlatformWindow.
  13. class COMPONENT_EXPORT(WM) WmMoveLoopHandler {
  14. public:
  15. // Starts a move loop for tab drag controller. Returns true on success or
  16. // false on fail/cancel.
  17. virtual bool RunMoveLoop(const gfx::Vector2d& drag_offset) = 0;
  18. // Ends the move loop.
  19. virtual void EndMoveLoop() = 0;
  20. protected:
  21. virtual ~WmMoveLoopHandler() {}
  22. };
  23. COMPONENT_EXPORT(WM)
  24. void SetWmMoveLoopHandler(PlatformWindow* platform_window,
  25. WmMoveLoopHandler* drag_handler);
  26. COMPONENT_EXPORT(WM)
  27. WmMoveLoopHandler* GetWmMoveLoopHandler(const PlatformWindow& platform_window);
  28. } // namespace ui
  29. #endif // UI_PLATFORM_WINDOW_WM_WM_MOVE_LOOP_HANDLER_H_