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