OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_DESKTOP_WINDOW_MOVE_CLIENT_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ |
7 | 7 |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
14 #include "ui/aura/client/window_move_client.h" | 14 #include "ui/aura/client/window_move_client.h" |
15 #include "ui/gfx/point.h" | 15 #include "ui/gfx/point.h" |
16 #include "ui/views/views_export.h" | 16 #include "ui/views/views_export.h" |
17 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h" | 17 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h" |
18 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h" | 18 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop_delegate.h" |
19 | 19 |
20 namespace aura { | 20 namespace aura { |
21 class WindowEventDispatcher; | 21 class WindowTreeHost; |
22 } | 22 } |
23 | 23 |
24 namespace gfx { | 24 namespace gfx { |
25 class Rect; | 25 class Rect; |
26 } | 26 } |
27 | 27 |
28 namespace views { | 28 namespace views { |
29 | 29 |
30 // When we're dragging tabs, we need to manually position our window. | 30 // When we're dragging tabs, we need to manually position our window. |
31 class VIEWS_EXPORT X11DesktopWindowMoveClient : | 31 class VIEWS_EXPORT X11DesktopWindowMoveClient : |
(...skipping 16 matching lines...) Expand all Loading... |
48 virtual void EndMoveLoop() OVERRIDE; | 48 virtual void EndMoveLoop() OVERRIDE; |
49 | 49 |
50 private: | 50 private: |
51 // Callback from |window_move_timer_|. | 51 // Callback from |window_move_timer_|. |
52 void SetHostBounds(const gfx::Rect& rect); | 52 void SetHostBounds(const gfx::Rect& rect); |
53 | 53 |
54 X11WholeScreenMoveLoop move_loop_; | 54 X11WholeScreenMoveLoop move_loop_; |
55 | 55 |
56 // We need to keep track of this so we can actually move it when reacting to | 56 // We need to keep track of this so we can actually move it when reacting to |
57 // mouse events. | 57 // mouse events. |
58 aura::WindowEventDispatcher* dispatcher_; | 58 aura::WindowTreeHost* host_; |
59 | 59 |
60 // Our cursor offset from the top left window origin when the drag | 60 // Our cursor offset from the top left window origin when the drag |
61 // started. Used to calculate the window's new bounds relative to the current | 61 // started. Used to calculate the window's new bounds relative to the current |
62 // location of the cursor. | 62 // location of the cursor. |
63 gfx::Vector2d window_offset_; | 63 gfx::Vector2d window_offset_; |
64 | 64 |
65 base::OneShotTimer<X11DesktopWindowMoveClient> window_move_timer_; | 65 base::OneShotTimer<X11DesktopWindowMoveClient> window_move_timer_; |
66 }; | 66 }; |
67 | 67 |
68 } // namespace views | 68 } // namespace views |
69 | 69 |
70 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ | 70 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ |
OLD | NEW |