| 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/message_loop/message_pump_dispatcher.h" | 11 #include "base/message_loop/message_pump_dispatcher.h" |
| 11 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/gfx/vector2d_f.h" | 14 #include "ui/gfx/vector2d_f.h" |
| 14 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h" | 15 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h" |
| 15 | 16 |
| 16 typedef struct _XDisplay XDisplay; | 17 typedef struct _XDisplay XDisplay; |
| 17 | 18 |
| 18 namespace aura { | 19 namespace aura { |
| 19 class Window; | 20 class Window; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Creates an input-only window to be used during the drag. | 56 // Creates an input-only window to be used during the drag. |
| 56 Window CreateDragInputWindow(XDisplay* display); | 57 Window CreateDragInputWindow(XDisplay* display); |
| 57 | 58 |
| 58 // Creates a window to show the drag image during the drag. | 59 // Creates a window to show the drag image during the drag. |
| 59 void CreateDragImageWindow(); | 60 void CreateDragImageWindow(); |
| 60 | 61 |
| 61 // Checks to see if |in_image| is an image that has any visible regions | 62 // Checks to see if |in_image| is an image that has any visible regions |
| 62 // (defined as having a pixel with alpha > 32). If so, return true. | 63 // (defined as having a pixel with alpha > 32). If so, return true. |
| 63 bool CheckIfIconValid(); | 64 bool CheckIfIconValid(); |
| 64 | 65 |
| 66 // Dispatch mouse movement event to |delegate_| in a posted task. |
| 67 void DispatchMouseMovement(); |
| 68 |
| 65 X11WholeScreenMoveLoopDelegate* delegate_; | 69 X11WholeScreenMoveLoopDelegate* delegate_; |
| 66 | 70 |
| 67 // Are we running a nested message loop from RunMoveLoop()? | 71 // Are we running a nested message loop from RunMoveLoop()? |
| 68 bool in_move_loop_; | 72 bool in_move_loop_; |
| 69 | 73 |
| 70 bool should_reset_mouse_flags_; | 74 bool should_reset_mouse_flags_; |
| 71 | 75 |
| 72 // An invisible InputOnly window . We create this window so we can track the | 76 // An invisible InputOnly window . We create this window so we can track the |
| 73 // cursor wherever it goes on screen during a drag, since normal windows | 77 // cursor wherever it goes on screen during a drag, since normal windows |
| 74 // don't receive pointer motion events outside of their bounds. | 78 // don't receive pointer motion events outside of their bounds. |
| 75 ::Window grab_input_window_; | 79 ::Window grab_input_window_; |
| 76 | 80 |
| 77 base::Closure quit_closure_; | 81 base::Closure quit_closure_; |
| 78 | 82 |
| 79 // A Widget is created during the drag if there is an image available to be | 83 // A Widget is created during the drag if there is an image available to be |
| 80 // used during the drag. | 84 // used during the drag. |
| 81 scoped_ptr<Widget> drag_widget_; | 85 scoped_ptr<Widget> drag_widget_; |
| 82 gfx::ImageSkia drag_image_; | 86 gfx::ImageSkia drag_image_; |
| 83 gfx::Vector2dF drag_offset_; | 87 gfx::Vector2dF drag_offset_; |
| 88 XMotionEvent last_xmotion_; |
| 89 base::WeakPtrFactory<X11WholeScreenMoveLoop> weak_factory_; |
| 84 | 90 |
| 85 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); | 91 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); |
| 86 }; | 92 }; |
| 87 | 93 |
| 88 } // namespace views | 94 } // namespace views |
| 89 | 95 |
| 90 #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 |