| 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 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // When we're dragging tabs, we need to manually position our window. | 28 // When we're dragging tabs, we need to manually position our window. |
| 29 class VIEWS_EXPORT X11DesktopWindowMoveClient : | 29 class VIEWS_EXPORT X11DesktopWindowMoveClient : |
| 30 public views::X11WholeScreenMoveLoopDelegate, | 30 public views::X11WholeScreenMoveLoopDelegate, |
| 31 public aura::client::WindowMoveClient { | 31 public aura::client::WindowMoveClient { |
| 32 public: | 32 public: |
| 33 X11DesktopWindowMoveClient(); | 33 X11DesktopWindowMoveClient(); |
| 34 virtual ~X11DesktopWindowMoveClient(); | 34 virtual ~X11DesktopWindowMoveClient(); |
| 35 | 35 |
| 36 // Overridden from X11WholeScreenMoveLoopDelegate: | 36 // Overridden from X11WholeScreenMoveLoopDelegate: |
| 37 virtual void OnMouseMovement(XMotionEvent* event) OVERRIDE; | 37 virtual void OnMouseMovement(XMotionEvent* event) OVERRIDE; |
| 38 virtual void OnMouseReleased() OVERRIDE; |
| 38 virtual void OnMoveLoopEnded() OVERRIDE; | 39 virtual void OnMoveLoopEnded() OVERRIDE; |
| 39 | 40 |
| 40 // Overridden from aura::client::WindowMoveClient: | 41 // Overridden from aura::client::WindowMoveClient: |
| 41 virtual aura::client::WindowMoveResult RunMoveLoop( | 42 virtual aura::client::WindowMoveResult RunMoveLoop( |
| 42 aura::Window* window, | 43 aura::Window* window, |
| 43 const gfx::Vector2d& drag_offset, | 44 const gfx::Vector2d& drag_offset, |
| 44 aura::client::WindowMoveSource move_source) OVERRIDE; | 45 aura::client::WindowMoveSource move_source) OVERRIDE; |
| 45 virtual void EndMoveLoop() OVERRIDE; | 46 virtual void EndMoveLoop() OVERRIDE; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 X11WholeScreenMoveLoop move_loop_; | 49 X11WholeScreenMoveLoop move_loop_; |
| 49 | 50 |
| 50 // We need to keep track of this so we can actually move it when reacting to | 51 // We need to keep track of this so we can actually move it when reacting to |
| 51 // mouse events. | 52 // mouse events. |
| 52 aura::RootWindow* root_window_; | 53 aura::RootWindow* root_window_; |
| 53 | 54 |
| 54 // Our cursor offset from the top left window origin when the drag | 55 // Our cursor offset from the top left window origin when the drag |
| 55 // started. Used to calculate the window's new bounds relative to the current | 56 // started. Used to calculate the window's new bounds relative to the current |
| 56 // location of the cursor. | 57 // location of the cursor. |
| 57 gfx::Vector2d window_offset_; | 58 gfx::Vector2d window_offset_; |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 } // namespace views | 61 } // namespace views |
| 61 | 62 |
| 62 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ | 63 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ |
| OLD | NEW |