| 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 "ash/wm/dock/dock_types.h" | 8 #include "ash/wm/dock/dock_types.h" |
| 9 #include "ash/wm/window_resizer.h" | 9 #include "ash/wm/window_resizer.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Point; | 15 class Point; |
| 16 class Rect; | 16 class Rect; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace aura { | 19 namespace aura { |
| 20 class RootWindow; | 20 class RootWindow; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 namespace internal { | |
| 25 | |
| 26 class DockedWindowLayoutManager; | 24 class DockedWindowLayoutManager; |
| 27 | 25 |
| 28 // DockWindowResizer is used by ToplevelWindowEventFilter to handle dragging, | 26 // DockWindowResizer is used by ToplevelWindowEventFilter to handle dragging, |
| 29 // moving or resizing of a window while it is docked to the side of a screen. | 27 // moving or resizing of a window while it is docked to the side of a screen. |
| 30 class ASH_EXPORT DockedWindowResizer : public WindowResizer { | 28 class ASH_EXPORT DockedWindowResizer : public WindowResizer { |
| 31 public: | 29 public: |
| 32 virtual ~DockedWindowResizer(); | 30 virtual ~DockedWindowResizer(); |
| 33 | 31 |
| 34 // Creates a new DockWindowResizer. The caller takes ownership of the | 32 // Creates a new DockWindowResizer. The caller takes ownership of the |
| 35 // returned object. The ownership of |next_window_resizer| is taken by the | 33 // returned object. The ownership of |next_window_resizer| is taken by the |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // end of the drag. | 68 // end of the drag. |
| 71 DockedAction MaybeReparentWindowOnDragCompletion(bool is_resized, | 69 DockedAction MaybeReparentWindowOnDragCompletion(bool is_resized, |
| 72 bool is_attached_panel); | 70 bool is_attached_panel); |
| 73 | 71 |
| 74 gfx::Point last_location_; | 72 gfx::Point last_location_; |
| 75 | 73 |
| 76 // Wraps a window resizer and adds detaching / reattaching during drags. | 74 // Wraps a window resizer and adds detaching / reattaching during drags. |
| 77 scoped_ptr<WindowResizer> next_window_resizer_; | 75 scoped_ptr<WindowResizer> next_window_resizer_; |
| 78 | 76 |
| 79 // Dock container window. | 77 // Dock container window. |
| 80 internal::DockedWindowLayoutManager* dock_layout_; | 78 DockedWindowLayoutManager* dock_layout_; |
| 81 internal::DockedWindowLayoutManager* initial_dock_layout_; | 79 DockedWindowLayoutManager* initial_dock_layout_; |
| 82 | 80 |
| 83 // Set to true once Drag() is invoked and the bounds of the window change. | 81 // Set to true once Drag() is invoked and the bounds of the window change. |
| 84 bool did_move_or_resize_; | 82 bool did_move_or_resize_; |
| 85 | 83 |
| 86 // Set to true if the window that is being dragged was docked before drag. | 84 // Set to true if the window that is being dragged was docked before drag. |
| 87 bool was_docked_; | 85 bool was_docked_; |
| 88 | 86 |
| 89 // True if the dragged window is docked during the drag. | 87 // True if the dragged window is docked during the drag. |
| 90 bool is_docked_; | 88 bool is_docked_; |
| 91 | 89 |
| 92 // True if the dragged window had |bounds_changed_by_user| before the drag. | 90 // True if the dragged window had |bounds_changed_by_user| before the drag. |
| 93 // Cleared whenever the target window gets dragged outside of the docked area. | 91 // Cleared whenever the target window gets dragged outside of the docked area. |
| 94 bool was_bounds_changed_by_user_; | 92 bool was_bounds_changed_by_user_; |
| 95 | 93 |
| 96 base::WeakPtrFactory<DockedWindowResizer> weak_ptr_factory_; | 94 base::WeakPtrFactory<DockedWindowResizer> weak_ptr_factory_; |
| 97 | 95 |
| 98 DISALLOW_COPY_AND_ASSIGN(DockedWindowResizer); | 96 DISALLOW_COPY_AND_ASSIGN(DockedWindowResizer); |
| 99 }; | 97 }; |
| 100 | 98 |
| 101 } // namespace internal | |
| 102 } // namespace ash | 99 } // namespace ash |
| 103 | 100 |
| 104 #endif // ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ | 101 #endif // ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ |
| OLD | NEW |