OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ | |
6 #define UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "ui/aura/client/window_move_client.h" | |
11 #include "ui/aura/event_filter.h" | |
12 #include "ui/views/views_export.h" | |
13 #include "ui/gfx/point.h" | |
14 | |
15 namespace views { | |
16 | |
17 // When we're dragging tabs, we need to manually position our window. | |
18 class VIEWS_EXPORT X11DesktopWindowMoveClient | |
19 : public aura::EventFilter, | |
20 public aura::client::WindowMoveClient { | |
21 public: | |
22 X11DesktopWindowMoveClient(); | |
23 virtual ~X11DesktopWindowMoveClient(); | |
24 | |
25 // Overridden from aura::EventFilter: | |
26 virtual bool PreHandleKeyEvent(aura::Window* target, | |
27 ui::KeyEvent* event) OVERRIDE; | |
28 virtual bool PreHandleMouseEvent(aura::Window* target, | |
29 ui::MouseEvent* event) OVERRIDE; | |
30 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, | |
31 ui::TouchEvent* event) OVERRIDE; | |
32 virtual ui::GestureStatus PreHandleGestureEvent( | |
33 aura::Window* target, | |
34 ui::GestureEvent* event) OVERRIDE; | |
35 | |
36 // Overridden from aura::client::WindowMoveClient: | |
37 virtual void RunMoveLoop(aura::Window* window, | |
38 const gfx::Point& drag_offset) OVERRIDE; | |
39 virtual void EndMoveLoop() OVERRIDE; | |
40 | |
41 private: | |
42 // Are we running a nested message loop from RunMoveLoop(). | |
Daniel Erat
2012/08/15 20:30:57
nit: s/\./?/
| |
43 bool in_move_loop_; | |
44 | |
45 // Our cursor offset on first invocation. | |
Daniel Erat
2012/08/15 20:30:57
what's it an offset from, the target window's orig
| |
46 gfx::Point window_offset_; | |
47 | |
48 base::Closure quit_closure_; | |
49 }; | |
50 | |
51 } // namespace views | |
52 | |
53 #endif // UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ | |
OLD | NEW |