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/aura/client/window_move_client.h" | 11 #include "ui/aura/client/window_move_client.h" |
12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
13 | 13 |
14 namespace aura { | 14 namespace aura { |
15 class Window; | 15 class Window; |
16 } | 16 } |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
| 19 namespace wm { |
| 20 class WindowState; |
| 21 } |
19 | 22 |
20 // WindowResizer is used by ToplevelWindowEventFilter to handle dragging, moving | 23 // WindowResizer is used by ToplevelWindowEventFilter to handle dragging, moving |
21 // or resizing a window. All coordinates passed to this are in the parent | 24 // or resizing a window. All coordinates passed to this are in the parent |
22 // windows coordinates. | 25 // windows coordinates. |
23 class ASH_EXPORT WindowResizer { | 26 class ASH_EXPORT WindowResizer { |
24 public: | 27 public: |
25 // Constants to identify the type of resize. | 28 // Constants to identify the type of resize. |
26 static const int kBoundsChange_None; | 29 static const int kBoundsChange_None; |
27 static const int kBoundsChange_Repositions; | 30 static const int kBoundsChange_Repositions; |
28 static const int kBoundsChange_Resizes; | 31 static const int kBoundsChange_Resizes; |
(...skipping 29 matching lines...) Expand all Loading... |
58 protected: | 61 protected: |
59 struct Details { | 62 struct Details { |
60 Details(); | 63 Details(); |
61 Details(aura::Window* window, | 64 Details(aura::Window* window, |
62 const gfx::Point& location, | 65 const gfx::Point& location, |
63 int window_component, | 66 int window_component, |
64 aura::client::WindowMoveSource source); | 67 aura::client::WindowMoveSource source); |
65 ~Details(); | 68 ~Details(); |
66 | 69 |
67 // The window we're resizing. | 70 // The window we're resizing. |
| 71 // TODO(oshima): replace this with accessor method to |
| 72 // |window_state->window()|. |
68 aura::Window* window; | 73 aura::Window* window; |
69 | 74 |
| 75 // The ash window state for the |window| above. |
| 76 wm::WindowState* window_state; |
| 77 |
70 // Initial bounds of the window in parent coordinates. | 78 // Initial bounds of the window in parent coordinates. |
71 gfx::Rect initial_bounds_in_parent; | 79 gfx::Rect initial_bounds_in_parent; |
72 | 80 |
73 // Restore bounds (in screen coordinates) of the window before the drag | 81 // Restore bounds (in screen coordinates) of the window before the drag |
74 // started. Only set if the window is normal and is being dragged. | 82 // started. Only set if the window is normal and is being dragged. |
75 gfx::Rect restore_bounds; | 83 gfx::Rect restore_bounds; |
76 | 84 |
77 // Location passed to the constructor, in |window->parent()|'s coordinates. | 85 // Location passed to the constructor, in |window->parent()|'s coordinates. |
78 gfx::Point initial_location_in_parent; | 86 gfx::Point initial_location_in_parent; |
79 | 87 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // initialized with NULL if |window| should not be resized nor dragged. | 148 // initialized with NULL if |window| should not be resized nor dragged. |
141 ASH_EXPORT scoped_ptr<WindowResizer> CreateWindowResizer( | 149 ASH_EXPORT scoped_ptr<WindowResizer> CreateWindowResizer( |
142 aura::Window* window, | 150 aura::Window* window, |
143 const gfx::Point& point_in_parent, | 151 const gfx::Point& point_in_parent, |
144 int window_component, | 152 int window_component, |
145 aura::client::WindowMoveSource source); | 153 aura::client::WindowMoveSource source); |
146 | 154 |
147 } // namespace ash | 155 } // namespace ash |
148 | 156 |
149 #endif // ASH_WM_WINDOW_RESIZER_H_ | 157 #endif // ASH_WM_WINDOW_RESIZER_H_ |
OLD | NEW |