| 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 ASH_WM_DRAG_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_DRAG_WINDOW_RESIZER_H_ |
| 6 #define ASH_WM_DRAG_WINDOW_RESIZER_H_ | 6 #define ASH_WM_DRAG_WINDOW_RESIZER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
| 9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 10 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "ui/gfx/geometry/point.h" | 15 #include "ui/gfx/geometry/point.h" |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 | 18 |
| 18 class DragWindowController; | 19 class DragWindowController; |
| 19 | 20 |
| 20 // DragWindowResizer is a decorator of WindowResizer and adds the ability to | 21 // DragWindowResizer is a decorator of WindowResizer and adds the ability to |
| 21 // drag windows across displays. | 22 // drag windows across displays. |
| 22 class ASH_EXPORT DragWindowResizer : public WindowResizer { | 23 class ASH_EXPORT DragWindowResizer : public WindowResizer { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 44 explicit DragWindowResizer(WindowResizer* next_window_resizer, | 45 explicit DragWindowResizer(WindowResizer* next_window_resizer, |
| 45 wm::WindowState* window_state); | 46 wm::WindowState* window_state); |
| 46 | 47 |
| 47 // Updates the bounds of the drag window for window dragging. | 48 // Updates the bounds of the drag window for window dragging. |
| 48 void UpdateDragWindow(const gfx::Rect& bounds_in_parent, | 49 void UpdateDragWindow(const gfx::Rect& bounds_in_parent, |
| 49 const gfx::Point& drag_location_in_screen); | 50 const gfx::Point& drag_location_in_screen); |
| 50 | 51 |
| 51 // Returns true if we should allow the mouse pointer to warp. | 52 // Returns true if we should allow the mouse pointer to warp. |
| 52 bool ShouldAllowMouseWarp(); | 53 bool ShouldAllowMouseWarp(); |
| 53 | 54 |
| 54 scoped_ptr<WindowResizer> next_window_resizer_; | 55 std::unique_ptr<WindowResizer> next_window_resizer_; |
| 55 | 56 |
| 56 // Shows a semi-transparent image of the window being dragged. | 57 // Shows a semi-transparent image of the window being dragged. |
| 57 scoped_ptr<DragWindowController> drag_window_controller_; | 58 std::unique_ptr<DragWindowController> drag_window_controller_; |
| 58 | 59 |
| 59 gfx::Point last_mouse_location_; | 60 gfx::Point last_mouse_location_; |
| 60 | 61 |
| 61 // Current instance for use by the DragWindowResizerTest. | 62 // Current instance for use by the DragWindowResizerTest. |
| 62 static DragWindowResizer* instance_; | 63 static DragWindowResizer* instance_; |
| 63 | 64 |
| 64 base::WeakPtrFactory<DragWindowResizer> weak_ptr_factory_; | 65 base::WeakPtrFactory<DragWindowResizer> weak_ptr_factory_; |
| 65 | 66 |
| 66 DISALLOW_COPY_AND_ASSIGN(DragWindowResizer); | 67 DISALLOW_COPY_AND_ASSIGN(DragWindowResizer); |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 } // namespace ash | 70 } // namespace ash |
| 70 | 71 |
| 71 #endif // ASH_WM_DRAG_WINDOW_RESIZER_H_ | 72 #endif // ASH_WM_DRAG_WINDOW_RESIZER_H_ |
| OLD | NEW |