| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
| 9 #include "ui/gfx/x/x11_types.h" | 9 #include "ui/gfx/x/x11_types.h" |
| 10 | 10 |
| 11 namespace views { | 11 namespace views { |
| 12 | 12 |
| 13 // Runs a nested message loop and grabs the mouse. This is used to implement | 13 // Runs a nested run loop and grabs the mouse. This is used to implement |
| 14 // dragging. | 14 // dragging. |
| 15 class X11MoveLoop { | 15 class X11MoveLoop { |
| 16 public: | 16 public: |
| 17 virtual ~X11MoveLoop() {} | 17 virtual ~X11MoveLoop() {} |
| 18 | 18 |
| 19 // Runs the nested message loop. While the mouse is grabbed, use |cursor| as | 19 // Runs the nested run loop. While the mouse is grabbed, use |cursor| as |
| 20 // the mouse cursor. Returns true if the move-loop is completed successfully. | 20 // the mouse cursor. Returns true if the move-loop is completed successfully. |
| 21 // If the pointer-grab fails, or the move-loop is canceled by the user (e.g. | 21 // If the pointer-grab fails, or the move-loop is canceled by the user (e.g. |
| 22 // by pressing escape), then returns false. | 22 // by pressing escape), then returns false. |
| 23 virtual bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor) = 0; | 23 virtual bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor) = 0; |
| 24 | 24 |
| 25 // Updates the cursor while the move loop is running. | 25 // Updates the cursor while the move loop is running. |
| 26 virtual void UpdateCursor(gfx::NativeCursor cursor) = 0; | 26 virtual void UpdateCursor(gfx::NativeCursor cursor) = 0; |
| 27 | 27 |
| 28 // Ends the move loop that's currently in progress. | 28 // Ends the move loop that's currently in progress. |
| 29 virtual void EndMoveLoop() = 0; | 29 virtual void EndMoveLoop() = 0; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 } // namespace views | 32 } // namespace views |
| 33 | 33 |
| 34 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ | 34 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ |
| OLD | NEW |