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_WORKSPACE_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
6 #define ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ | 6 #define ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static const int kMinOnscreenHeight; | 42 static const int kMinOnscreenHeight; |
43 | 43 |
44 // Snap region when dragging close to the edges. That is, as the window gets | 44 // Snap region when dragging close to the edges. That is, as the window gets |
45 // this close to an edge of the screen it snaps to the edge. | 45 // this close to an edge of the screen it snaps to the edge. |
46 static const int kScreenEdgeInset; | 46 static const int kScreenEdgeInset; |
47 | 47 |
48 // Distance in pixels that the cursor must move past an edge for a window | 48 // Distance in pixels that the cursor must move past an edge for a window |
49 // to move or resize beyond that edge. | 49 // to move or resize beyond that edge. |
50 static const int kStickyDistancePixels; | 50 static const int kStickyDistancePixels; |
51 | 51 |
52 virtual ~WorkspaceWindowResizer(); | 52 ~WorkspaceWindowResizer() override; |
53 | 53 |
54 static WorkspaceWindowResizer* Create( | 54 static WorkspaceWindowResizer* Create( |
55 wm::WindowState* window_state, | 55 wm::WindowState* window_state, |
56 const std::vector<aura::Window*>& attached_windows); | 56 const std::vector<aura::Window*>& attached_windows); |
57 | 57 |
58 // WindowResizer: | 58 // WindowResizer: |
59 virtual void Drag(const gfx::Point& location_in_parent, | 59 void Drag(const gfx::Point& location_in_parent, int event_flags) override; |
60 int event_flags) override; | 60 void CompleteDrag() override; |
61 virtual void CompleteDrag() override; | 61 void RevertDrag() override; |
62 virtual void RevertDrag() override; | |
63 | 62 |
64 private: | 63 private: |
65 WorkspaceWindowResizer(wm::WindowState* window_state, | 64 WorkspaceWindowResizer(wm::WindowState* window_state, |
66 const std::vector<aura::Window*>& attached_windows); | 65 const std::vector<aura::Window*>& attached_windows); |
67 | 66 |
68 private: | 67 private: |
69 friend class WorkspaceWindowResizerTest; | 68 friend class WorkspaceWindowResizerTest; |
70 | 69 |
71 // The edge to which the window should be snapped at the end of the drag. | 70 // The edge to which the window should be snapped at the end of the drag. |
72 enum SnapType { | 71 enum SnapType { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // Used to determine if this has been deleted during a drag such as when a tab | 222 // Used to determine if this has been deleted during a drag such as when a tab |
224 // gets dragged into another browser window. | 223 // gets dragged into another browser window. |
225 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_; | 224 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_; |
226 | 225 |
227 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); | 226 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); |
228 }; | 227 }; |
229 | 228 |
230 } // namespace ash | 229 } // namespace ash |
231 | 230 |
232 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ | 231 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
OLD | NEW |