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 "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace views { | 29 namespace views { |
30 | 30 |
31 class Widget; | 31 class Widget; |
32 | 32 |
33 // Runs a nested message loop and grabs the mouse. This is used to implement | 33 // Runs a nested message loop and grabs the mouse. This is used to implement |
34 // dragging. | 34 // dragging. |
35 class X11WholeScreenMoveLoop : public X11MoveLoop, | 35 class X11WholeScreenMoveLoop : public X11MoveLoop, |
36 public ui::PlatformEventDispatcher { | 36 public ui::PlatformEventDispatcher { |
37 public: | 37 public: |
38 explicit X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate); | 38 explicit X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate); |
39 virtual ~X11WholeScreenMoveLoop(); | 39 ~X11WholeScreenMoveLoop() override; |
40 | 40 |
41 // ui:::PlatformEventDispatcher: | 41 // ui:::PlatformEventDispatcher: |
42 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 42 bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
43 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 43 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; |
44 | 44 |
45 // X11MoveLoop: | 45 // X11MoveLoop: |
46 virtual bool RunMoveLoop(aura::Window* window, | 46 bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor) override; |
47 gfx::NativeCursor cursor) override; | 47 void UpdateCursor(gfx::NativeCursor cursor) override; |
48 virtual void UpdateCursor(gfx::NativeCursor cursor) override; | 48 void EndMoveLoop() override; |
49 virtual void EndMoveLoop() override; | |
50 | 49 |
51 private: | 50 private: |
52 // Grabs the pointer, setting the mouse cursor to |cursor|. Returns true if | 51 // Grabs the pointer, setting the mouse cursor to |cursor|. Returns true if |
53 // successful. | 52 // successful. |
54 bool GrabPointer(gfx::NativeCursor cursor); | 53 bool GrabPointer(gfx::NativeCursor cursor); |
55 | 54 |
56 void GrabEscKey(); | 55 void GrabEscKey(); |
57 | 56 |
58 // Creates an input-only window to be used during the drag. | 57 // Creates an input-only window to be used during the drag. |
59 Window CreateDragInputWindow(XDisplay* display); | 58 Window CreateDragInputWindow(XDisplay* display); |
(...skipping 28 matching lines...) Expand all Loading... |
88 | 87 |
89 XMotionEvent last_xmotion_; | 88 XMotionEvent last_xmotion_; |
90 base::WeakPtrFactory<X11WholeScreenMoveLoop> weak_factory_; | 89 base::WeakPtrFactory<X11WholeScreenMoveLoop> weak_factory_; |
91 | 90 |
92 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); | 91 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); |
93 }; | 92 }; |
94 | 93 |
95 } // namespace views | 94 } // namespace views |
96 | 95 |
97 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ | 96 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ |
OLD | NEW |