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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_pump_dispatcher.h" |
10 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
11 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
12 #include "ui/gfx/vector2d_f.h" | 13 #include "ui/gfx/vector2d_f.h" |
13 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h" | 14 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h" |
14 | 15 |
15 typedef struct _XDisplay XDisplay; | 16 typedef struct _XDisplay XDisplay; |
16 | 17 |
17 namespace aura { | 18 namespace aura { |
18 class Window; | 19 class Window; |
19 } | 20 } |
20 | 21 |
21 namespace views { | 22 namespace views { |
22 | 23 |
23 class Widget; | 24 class Widget; |
24 | 25 |
25 // Runs a nested message loop and grabs the mouse. This is used to implement | 26 // Runs a nested message loop and grabs the mouse. This is used to implement |
26 // dragging. | 27 // dragging. |
27 class X11WholeScreenMoveLoop : public base::MessageLoop::Dispatcher { | 28 class X11WholeScreenMoveLoop : public base::MessagePumpDispatcher { |
28 public: | 29 public: |
29 explicit X11WholeScreenMoveLoop(X11WholeScreenMoveLoopDelegate* delegate); | 30 explicit X11WholeScreenMoveLoop(X11WholeScreenMoveLoopDelegate* delegate); |
30 virtual ~X11WholeScreenMoveLoop(); | 31 virtual ~X11WholeScreenMoveLoop(); |
31 | 32 |
32 // Overridden from base::MessageLoop::Dispatcher: | 33 // Overridden from base::MessagePumpDispatcher: |
33 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; | 34 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
34 | 35 |
35 // Runs the nested message loop. While the mouse is grabbed, use |cursor| as | 36 // Runs the nested message loop. While the mouse is grabbed, use |cursor| as |
36 // the mouse cursor. Returns true if there we were able to grab the pointer | 37 // the mouse cursor. Returns true if there we were able to grab the pointer |
37 // and run the move loop. | 38 // and run the move loop. |
38 bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor); | 39 bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor); |
39 | 40 |
40 // Updates the cursor while the move loop is running. | 41 // Updates the cursor while the move loop is running. |
41 void UpdateCursor(gfx::NativeCursor cursor); | 42 void UpdateCursor(gfx::NativeCursor cursor); |
42 | 43 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 scoped_ptr<Widget> drag_widget_; | 77 scoped_ptr<Widget> drag_widget_; |
77 gfx::ImageSkia drag_image_; | 78 gfx::ImageSkia drag_image_; |
78 gfx::Vector2dF drag_offset_; | 79 gfx::Vector2dF drag_offset_; |
79 | 80 |
80 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); | 81 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); |
81 }; | 82 }; |
82 | 83 |
83 } // namespace views | 84 } // namespace views |
84 | 85 |
85 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ | 86 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ |
OLD | NEW |