OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DOCK_DOCK_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ |
6 #define ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ | 6 #define ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "ash/wm/dock/dock_types.h" | 10 #include "ash/wm/dock/dock_types.h" |
9 #include "ash/wm/window_resizer.h" | 11 #include "ash/wm/window_resizer.h" |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 | 15 |
15 namespace gfx { | 16 namespace gfx { |
16 class Point; | 17 class Point; |
17 class Rect; | 18 class Rect; |
18 } | 19 } |
19 | 20 |
20 namespace aura { | 21 namespace aura { |
21 class RootWindow; | 22 class RootWindow; |
22 } | 23 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // can be reported in UMA stats. |is_resized| reports if the window is merely | 69 // can be reported in UMA stats. |is_resized| reports if the window is merely |
69 // being resized rather than repositioned. |attached_panel| is necessary to | 70 // being resized rather than repositioned. |attached_panel| is necessary to |
70 // avoid docking panels that have been attached to the launcher shelf at the | 71 // avoid docking panels that have been attached to the launcher shelf at the |
71 // end of the drag. | 72 // end of the drag. |
72 DockedAction MaybeReparentWindowOnDragCompletion(bool is_resized, | 73 DockedAction MaybeReparentWindowOnDragCompletion(bool is_resized, |
73 bool is_attached_panel); | 74 bool is_attached_panel); |
74 | 75 |
75 gfx::Point last_location_; | 76 gfx::Point last_location_; |
76 | 77 |
77 // Wraps a window resizer and adds detaching / reattaching during drags. | 78 // Wraps a window resizer and adds detaching / reattaching during drags. |
78 scoped_ptr<WindowResizer> next_window_resizer_; | 79 std::unique_ptr<WindowResizer> next_window_resizer_; |
79 | 80 |
80 // Dock container window. | 81 // Dock container window. |
81 DockedWindowLayoutManager* dock_layout_; | 82 DockedWindowLayoutManager* dock_layout_; |
82 DockedWindowLayoutManager* initial_dock_layout_; | 83 DockedWindowLayoutManager* initial_dock_layout_; |
83 | 84 |
84 // Set to true once Drag() is invoked and the bounds of the window change. | 85 // Set to true once Drag() is invoked and the bounds of the window change. |
85 bool did_move_or_resize_; | 86 bool did_move_or_resize_; |
86 | 87 |
87 // Set to true if the window that is being dragged was docked before drag. | 88 // Set to true if the window that is being dragged was docked before drag. |
88 bool was_docked_; | 89 bool was_docked_; |
89 | 90 |
90 // True if the dragged window is docked during the drag. | 91 // True if the dragged window is docked during the drag. |
91 bool is_docked_; | 92 bool is_docked_; |
92 | 93 |
93 // True if the dragged window had |bounds_changed_by_user| before the drag. | 94 // True if the dragged window had |bounds_changed_by_user| before the drag. |
94 // Cleared whenever the target window gets dragged outside of the docked area. | 95 // Cleared whenever the target window gets dragged outside of the docked area. |
95 bool was_bounds_changed_by_user_; | 96 bool was_bounds_changed_by_user_; |
96 | 97 |
97 base::WeakPtrFactory<DockedWindowResizer> weak_ptr_factory_; | 98 base::WeakPtrFactory<DockedWindowResizer> weak_ptr_factory_; |
98 | 99 |
99 DISALLOW_COPY_AND_ASSIGN(DockedWindowResizer); | 100 DISALLOW_COPY_AND_ASSIGN(DockedWindowResizer); |
100 }; | 101 }; |
101 | 102 |
102 } // namespace ash | 103 } // namespace ash |
103 | 104 |
104 #endif // ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ | 105 #endif // ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ |
OLD | NEW |