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_PANELS_PANEL_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_ |
6 #define ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_ | 6 #define ASH_WM_PANELS_PANEL_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/window_resizer.h" | 11 #include "ash/wm/window_resizer.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
16 class Rect; | 16 class Rect; |
17 class Point; | 17 class Point; |
18 } | 18 } |
19 | 19 |
20 namespace ash { | 20 namespace ash { |
21 | 21 |
| 22 class PanelLayoutManager; |
| 23 |
22 // PanelWindowResizer is used by ToplevelWindowEventFilter to handle dragging, | 24 // PanelWindowResizer is used by ToplevelWindowEventFilter to handle dragging, |
23 // moving or resizing panel window. These can be attached and detached from the | 25 // moving or resizing panel window. These can be attached and detached from the |
24 // launcher. | 26 // launcher. |
25 class ASH_EXPORT PanelWindowResizer : public WindowResizer { | 27 class ASH_EXPORT PanelWindowResizer : public WindowResizer { |
26 public: | 28 public: |
27 ~PanelWindowResizer() override; | 29 ~PanelWindowResizer() override; |
28 | 30 |
29 // Creates a new PanelWindowResizer. The caller takes ownership of the | 31 // Creates a new PanelWindowResizer. The caller takes ownership of the |
30 // returned object. The ownership of |next_window_resizer| is taken by the | 32 // returned object. The ownership of |next_window_resizer| is taken by the |
31 // returned object. Returns NULL if not resizable. | 33 // returned object. Returns NULL if not resizable. |
(...skipping 21 matching lines...) Expand all Loading... |
53 // and informs the PanelLayoutManager that a drag has started if necessary. | 55 // and informs the PanelLayoutManager that a drag has started if necessary. |
54 void StartedDragging(); | 56 void StartedDragging(); |
55 | 57 |
56 // Informs the PanelLayoutManager that the drag is complete if it was informed | 58 // Informs the PanelLayoutManager that the drag is complete if it was informed |
57 // of the drag start. | 59 // of the drag start. |
58 void FinishDragging(); | 60 void FinishDragging(); |
59 | 61 |
60 // Updates the dragged panel's index in the launcher. | 62 // Updates the dragged panel's index in the launcher. |
61 void UpdateLauncherPosition(); | 63 void UpdateLauncherPosition(); |
62 | 64 |
| 65 // Returns the PanelLayoutManager associated with |panel_container_|. |
| 66 PanelLayoutManager* GetPanelLayoutManager(); |
| 67 |
63 // Last pointer location in screen coordinates. | 68 // Last pointer location in screen coordinates. |
64 gfx::Point last_location_; | 69 gfx::Point last_location_; |
65 | 70 |
66 // Wraps a window resizer and adds panel detaching / reattaching and snapping | 71 // Wraps a window resizer and adds panel detaching / reattaching and snapping |
67 // to launcher behavior during drags. | 72 // to launcher behavior during drags. |
68 std::unique_ptr<WindowResizer> next_window_resizer_; | 73 std::unique_ptr<WindowResizer> next_window_resizer_; |
69 | 74 |
70 // Panel container window. | 75 // Panel container window. |
71 WmWindow* panel_container_; | 76 aura::Window* panel_container_; |
72 WmWindow* initial_panel_container_; | 77 aura::Window* initial_panel_container_; |
73 | 78 |
74 // Set to true once Drag() is invoked and the bounds of the window change. | 79 // Set to true once Drag() is invoked and the bounds of the window change. |
75 bool did_move_or_resize_; | 80 bool did_move_or_resize_; |
76 | 81 |
77 // True if the window started attached to the launcher. | 82 // True if the window started attached to the launcher. |
78 const bool was_attached_; | 83 const bool was_attached_; |
79 | 84 |
80 base::WeakPtrFactory<PanelWindowResizer> weak_ptr_factory_; | 85 base::WeakPtrFactory<PanelWindowResizer> weak_ptr_factory_; |
81 | 86 |
82 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizer); | 87 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizer); |
83 }; | 88 }; |
84 | 89 |
85 } // namespace ash | 90 } // namespace ash |
86 | 91 |
87 #endif // ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_ | 92 #endif // ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_ |
OLD | NEW |