| 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_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_WINDOW_RESIZER_H_ |
| 6 #define ASH_WM_WINDOW_RESIZER_H_ | 6 #define ASH_WM_WINDOW_RESIZER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/wm/drag_details.h" | 11 #include "ash/wm/drag_details.h" |
| 12 #include "ash/wm/window_state.h" | 12 #include "ash/wm/window_state.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "ui/wm/public/window_move_client.h" | 14 #include "ui/wm/public/window_move_client.h" |
| 15 | 15 |
| 16 namespace aura { | |
| 17 class Window; | |
| 18 } | |
| 19 | |
| 20 namespace gfx { | 16 namespace gfx { |
| 21 class Rect; | 17 class Rect; |
| 22 } | 18 } |
| 23 | 19 |
| 24 namespace ash { | 20 namespace ash { |
| 25 namespace wm { | 21 namespace wm { |
| 26 class WmWindow; | 22 class WmWindow; |
| 27 } | 23 } |
| 28 | 24 |
| 29 // WindowResizer is used by ToplevelWindowEventFilter to handle dragging, moving | 25 // WindowResizer is used by ToplevelWindowEventFilter to handle dragging, moving |
| (...skipping 28 matching lines...) Expand all Loading... |
| 58 // Invoked to complete the drag. | 54 // Invoked to complete the drag. |
| 59 virtual void CompleteDrag() = 0; | 55 virtual void CompleteDrag() = 0; |
| 60 | 56 |
| 61 // Reverts the drag. | 57 // Reverts the drag. |
| 62 virtual void RevertDrag() = 0; | 58 virtual void RevertDrag() = 0; |
| 63 | 59 |
| 64 // Returns the target window the resizer was created for. | 60 // Returns the target window the resizer was created for. |
| 65 wm::WmWindow* GetTarget() const { | 61 wm::WmWindow* GetTarget() const { |
| 66 return window_state_ ? window_state_->window() : nullptr; | 62 return window_state_ ? window_state_->window() : nullptr; |
| 67 } | 63 } |
| 68 // Deprecated. | |
| 69 // TODO(sky): remove. | |
| 70 aura::Window* GetAuraTarget() const { | |
| 71 return window_state_ ? window_state_->aura_window() : nullptr; | |
| 72 } | |
| 73 | |
| 74 // See comment for |DragDetails::initial_location_in_parent|. | 64 // See comment for |DragDetails::initial_location_in_parent|. |
| 75 const gfx::Point& GetInitialLocation() const { | 65 const gfx::Point& GetInitialLocation() const { |
| 76 return window_state_->drag_details()->initial_location_in_parent; | 66 return window_state_->drag_details()->initial_location_in_parent; |
| 77 } | 67 } |
| 78 | 68 |
| 79 // Drag parameters established when drag starts. | 69 // Drag parameters established when drag starts. |
| 80 const DragDetails& details() const { return *window_state_->drag_details(); } | 70 const DragDetails& details() const { return *window_state_->drag_details(); } |
| 81 | 71 |
| 82 protected: | 72 protected: |
| 83 gfx::Rect CalculateBoundsForDrag(const gfx::Point& location); | 73 gfx::Rect CalculateBoundsForDrag(const gfx::Point& location); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 112 // |window| should not be resized nor dragged. | 102 // |window| should not be resized nor dragged. |
| 113 ASH_EXPORT std::unique_ptr<WindowResizer> CreateWindowResizer( | 103 ASH_EXPORT std::unique_ptr<WindowResizer> CreateWindowResizer( |
| 114 wm::WmWindow* window, | 104 wm::WmWindow* window, |
| 115 const gfx::Point& point_in_parent, | 105 const gfx::Point& point_in_parent, |
| 116 int window_component, | 106 int window_component, |
| 117 aura::client::WindowMoveSource source); | 107 aura::client::WindowMoveSource source); |
| 118 | 108 |
| 119 } // namespace ash | 109 } // namespace ash |
| 120 | 110 |
| 121 #endif // ASH_WM_WINDOW_RESIZER_H_ | 111 #endif // ASH_WM_WINDOW_RESIZER_H_ |
| OLD | NEW |