| 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 "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 class Window; | 14 class Window; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace ash { | 17 namespace ash { |
| 18 | 18 |
| 19 class WindowResizerOwner; |
| 20 |
| 19 // WindowResizer is used by ToplevelWindowEventFilter to handle dragging, moving | 21 // WindowResizer is used by ToplevelWindowEventFilter to handle dragging, moving |
| 20 // or resizing a window. All coordinates passed to this are in the parent | 22 // or resizing a window. All coordinates passed to this are in the parent |
| 21 // windows coordinates. | 23 // windows coordinates. |
| 22 class ASH_EXPORT WindowResizer { | 24 class ASH_EXPORT WindowResizer { |
| 23 public: | 25 public: |
| 24 // Constants to identify the type of resize. | 26 // Constants to identify the type of resize. |
| 25 static const int kBoundsChange_None; | 27 static const int kBoundsChange_None; |
| 26 static const int kBoundsChange_Repositions; | 28 static const int kBoundsChange_Repositions; |
| 27 static const int kBoundsChange_Resizes; | 29 static const int kBoundsChange_Resizes; |
| 28 | 30 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 int* delta_x); | 119 int* delta_x); |
| 118 | 120 |
| 119 // Returns the height of the drag. | 121 // Returns the height of the drag. |
| 120 static int GetHeightForDrag(const Details& details, | 122 static int GetHeightForDrag(const Details& details, |
| 121 int min_height, | 123 int min_height, |
| 122 int* delta_y); | 124 int* delta_y); |
| 123 }; | 125 }; |
| 124 | 126 |
| 125 // Creates a WindowResizer for |window|. This can return a scoped_ptr | 127 // Creates a WindowResizer for |window|. This can return a scoped_ptr |
| 126 // initialized with NULL if |window| should not be resized nor dragged. | 128 // initialized with NULL if |window| should not be resized nor dragged. |
| 129 // If |owner| is not NULL the resizer may pass itself to other resizer owners. |
| 127 ASH_EXPORT scoped_ptr<WindowResizer> CreateWindowResizer( | 130 ASH_EXPORT scoped_ptr<WindowResizer> CreateWindowResizer( |
| 131 WindowResizerOwner* owner, |
| 128 aura::Window* window, | 132 aura::Window* window, |
| 129 const gfx::Point& point_in_parent, | 133 const gfx::Point& point_in_parent, |
| 130 int window_component); | 134 int window_component); |
| 131 | 135 |
| 132 } // namespace aura | 136 } // namespace aura |
| 133 | 137 |
| 134 #endif // ASH_WM_WINDOW_RESIZER_H_ | 138 #endif // ASH_WM_WINDOW_RESIZER_H_ |
| OLD | NEW |