Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / wm / public / window_move_client.h
blobfbfa92d2ed2989a817b5b67193d159795fa224c8
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.
5 #ifndef UI_WM_PUBLIC_WINDOW_MOVE_CLIENT_H_
6 #define UI_WM_PUBLIC_WINDOW_MOVE_CLIENT_H_
8 #include "ui/aura/aura_export.h"
9 #include "ui/gfx/geometry/vector2d.h"
11 namespace gfx {
12 class Point;
15 namespace aura {
16 class Window;
17 namespace client {
19 enum WindowMoveResult {
20 MOVE_SUCCESSFUL, // Moving window was successful.
21 MOVE_CANCELED // Moving window was canceled.
24 enum WindowMoveSource {
25 WINDOW_MOVE_SOURCE_MOUSE,
26 WINDOW_MOVE_SOURCE_TOUCH,
29 // An interface implemented by an object that manages programatically keyed
30 // window moving.
31 class AURA_EXPORT WindowMoveClient {
32 public:
33 // Starts a nested message loop for moving the window. |drag_offset| is the
34 // offset from the window origin to the cursor when the drag was started.
35 // Returns MOVE_SUCCESSFUL if the move has completed successfully, or
36 // MOVE_CANCELED otherwise.
37 virtual WindowMoveResult RunMoveLoop(Window* window,
38 const gfx::Vector2d& drag_offset,
39 WindowMoveSource source) = 0;
41 // Ends a previously started move loop.
42 virtual void EndMoveLoop() = 0;
44 protected:
45 virtual ~WindowMoveClient() {}
48 // Sets/Gets the activation client for the specified window.
49 AURA_EXPORT void SetWindowMoveClient(Window* window,
50 WindowMoveClient* client);
51 AURA_EXPORT WindowMoveClient* GetWindowMoveClient(Window* window);
53 } // namespace client
54 } // namespace aura
56 #endif // UI_WM_PUBLIC_WINDOW_MOVE_CLIENT_H_