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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // Returns a location >= |location| that is aligned to fall on increments of | 46 // Returns a location >= |location| that is aligned to fall on increments of |
47 // |grid_size|. | 47 // |grid_size|. |
48 static int AlignToGrid(int location, int grid_size); | 48 static int AlignToGrid(int location, int grid_size); |
49 | 49 |
50 // Invoked to drag/move/resize the window. |location| is in the coordinates | 50 // Invoked to drag/move/resize the window. |location| is in the coordinates |
51 // of the window supplied to the constructor. | 51 // of the window supplied to the constructor. |
52 void Drag(const gfx::Point& location); | 52 void Drag(const gfx::Point& location); |
53 | 53 |
54 // Invoked to complete the drag. | 54 // Invoked to complete the drag. |
55 void CompleteDrag(); | 55 virtual void CompleteDrag(); |
| 56 |
| 57 // Reverts the drag. |
| 58 virtual void RevertDrag(); |
56 | 59 |
57 // Returns true if the drag will result in changing the window in anyway. | 60 // Returns true if the drag will result in changing the window in anyway. |
58 bool is_resizable() const { return is_resizable_; } | 61 bool is_resizable() const { return is_resizable_; } |
59 | 62 |
60 // See description above members for details. | 63 // See description above members for details. |
61 const gfx::Rect& initial_bounds() const { return initial_bounds_; } | 64 const gfx::Rect& initial_bounds() const { return initial_bounds_; } |
62 const gfx::Point& initial_location_in_parent() const { | 65 const gfx::Point& initial_location_in_parent() const { |
63 return initial_location_in_parent_; | 66 return initial_location_in_parent_; |
64 } | 67 } |
65 int window_component() const { return window_component_; } | 68 int window_component() const { return window_component_; } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 bool did_move_or_resize_; | 125 bool did_move_or_resize_; |
123 | 126 |
124 internal::RootWindowEventFilter* root_filter_; | 127 internal::RootWindowEventFilter* root_filter_; |
125 | 128 |
126 DISALLOW_COPY_AND_ASSIGN(WindowResizer); | 129 DISALLOW_COPY_AND_ASSIGN(WindowResizer); |
127 }; | 130 }; |
128 | 131 |
129 } // namespace aura | 132 } // namespace aura |
130 | 133 |
131 #endif // ASH_WM_WINDOW_RESIZER_H_ | 134 #endif // ASH_WM_WINDOW_RESIZER_H_ |
OLD | NEW |