Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h

Issue 254573002: Sets X11WholeScreenMoveLoop as OverrideDispatcher to get events even before grab is granted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sets X11WholeScreenMoveLoop as OverrideDispatcher to get events even before grab is granted Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "ui/events/platform/platform_event_dispatcher.h" 11 #include "ui/events/platform/platform_event_dispatcher.h"
12 #include "ui/events/platform/scoped_event_dispatcher.h"
12 #include "ui/gfx/image/image_skia.h" 13 #include "ui/gfx/image/image_skia.h"
13 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/vector2d_f.h" 15 #include "ui/gfx/vector2d_f.h"
15 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h" 16 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h"
16 17
17 typedef struct _XDisplay XDisplay; 18 typedef struct _XDisplay XDisplay;
18 19
19 namespace aura { 20 namespace aura {
20 class Window; 21 class Window;
21 } 22 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // (defined as having a pixel with alpha > 32). If so, return true. 66 // (defined as having a pixel with alpha > 32). If so, return true.
66 bool CheckIfIconValid(); 67 bool CheckIfIconValid();
67 68
68 // Dispatch mouse movement event to |delegate_| in a posted task. 69 // Dispatch mouse movement event to |delegate_| in a posted task.
69 void DispatchMouseMovement(); 70 void DispatchMouseMovement();
70 71
71 X11WholeScreenMoveLoopDelegate* delegate_; 72 X11WholeScreenMoveLoopDelegate* delegate_;
72 73
73 // Are we running a nested message loop from RunMoveLoop()? 74 // Are we running a nested message loop from RunMoveLoop()?
74 bool in_move_loop_; 75 bool in_move_loop_;
76 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_;
75 77
76 bool should_reset_mouse_flags_; 78 bool should_reset_mouse_flags_;
77 79
78 // An invisible InputOnly window . We create this window so we can track the 80 // An invisible InputOnly window . We create this window so we can track the
79 // cursor wherever it goes on screen during a drag, since normal windows 81 // cursor wherever it goes on screen during a drag, since normal windows
80 // don't receive pointer motion events outside of their bounds. 82 // don't receive pointer motion events outside of their bounds.
81 ::Window grab_input_window_; 83 ::Window grab_input_window_;
82 84
83 base::Closure quit_closure_; 85 base::Closure quit_closure_;
84 86
85 // Keeps track of whether the move-loop is cancled by the user (e.g. by 87 // Keeps track of whether the move-loop is cancled by the user (e.g. by
86 // pressing escape). 88 // pressing escape).
87 bool canceled_; 89 bool canceled_;
88 90
89 // A Widget is created during the drag if there is an image available to be 91 // A Widget is created during the drag if there is an image available to be
90 // used during the drag. 92 // used during the drag.
91 scoped_ptr<Widget> drag_widget_; 93 scoped_ptr<Widget> drag_widget_;
92 gfx::ImageSkia drag_image_; 94 gfx::ImageSkia drag_image_;
93 gfx::Vector2dF drag_offset_; 95 gfx::Vector2dF drag_offset_;
94 XMotionEvent last_xmotion_; 96 XMotionEvent last_xmotion_;
95 base::WeakPtrFactory<X11WholeScreenMoveLoop> weak_factory_; 97 base::WeakPtrFactory<X11WholeScreenMoveLoop> weak_factory_;
96 98
97 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); 99 DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop);
98 }; 100 };
99 101
100 } // namespace views 102 } // namespace views
101 103
102 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ 104 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698