| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_WHOLE_SCREEN_MOVE_LOOP_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace ui { | 27 namespace ui { |
| 28 class MouseEvent; | 28 class MouseEvent; |
| 29 class ScopedEventDispatcher; | 29 class ScopedEventDispatcher; |
| 30 class XScopedEventSelector; | 30 class XScopedEventSelector; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace views { | 33 namespace views { |
| 34 | 34 |
| 35 // Runs a nested message loop and grabs the mouse. This is used to implement | 35 // Runs a nested run loop and grabs the mouse. This is used to implement |
| 36 // dragging. | 36 // dragging. |
| 37 class X11WholeScreenMoveLoop : public X11MoveLoop, | 37 class X11WholeScreenMoveLoop : public X11MoveLoop, |
| 38 public ui::PlatformEventDispatcher { | 38 public ui::PlatformEventDispatcher { |
| 39 public: | 39 public: |
| 40 explicit X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate); | 40 explicit X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate); |
| 41 ~X11WholeScreenMoveLoop() override; | 41 ~X11WholeScreenMoveLoop() override; |
| 42 | 42 |
| 43 // ui:::PlatformEventDispatcher: | 43 // ui:::PlatformEventDispatcher: |
| 44 bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 44 bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
| 45 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 45 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 57 void GrabEscKey(); | 57 void GrabEscKey(); |
| 58 | 58 |
| 59 // Creates an input-only window to be used during the drag. | 59 // Creates an input-only window to be used during the drag. |
| 60 void CreateDragInputWindow(XDisplay* display); | 60 void CreateDragInputWindow(XDisplay* display); |
| 61 | 61 |
| 62 // Dispatch mouse movement event to |delegate_| in a posted task. | 62 // Dispatch mouse movement event to |delegate_| in a posted task. |
| 63 void DispatchMouseMovement(); | 63 void DispatchMouseMovement(); |
| 64 | 64 |
| 65 X11MoveLoopDelegate* delegate_; | 65 X11MoveLoopDelegate* delegate_; |
| 66 | 66 |
| 67 // Are we running a nested message loop from RunMoveLoop()? | 67 // Are we running a nested run loop from RunMoveLoop()? |
| 68 bool in_move_loop_; | 68 bool in_move_loop_; |
| 69 std::unique_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; | 69 std::unique_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; |
| 70 | 70 |
| 71 // Cursor in use prior to the move loop starting. Restored when the move loop | 71 // Cursor in use prior to the move loop starting. Restored when the move loop |
| 72 // quits. | 72 // quits. |
| 73 gfx::NativeCursor initial_cursor_; | 73 gfx::NativeCursor initial_cursor_; |
| 74 | 74 |
| 75 bool should_reset_mouse_flags_; | 75 bool should_reset_mouse_flags_; |
| 76 | 76 |
| 77 // An invisible InputOnly window. Keyboard grab and sometimes mouse grab | 77 // An invisible InputOnly window. Keyboard grab and sometimes mouse grab |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 | 92 |
| 93 std::unique_ptr<ui::MouseEvent> last_motion_in_screen_; | 93 std::unique_ptr<ui::MouseEvent> last_motion_in_screen_; |
| 94 base::WeakPtrFactory<X11WholeScreenMoveLoop> weak_factory_; | 94 base::WeakPtrFactory<X11WholeScreenMoveLoop> weak_factory_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); | 96 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace views | 99 } // namespace views |
| 100 | 100 |
| 101 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ | 101 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ |
| OLD | NEW |