Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ | |
| 6 #define ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ | |
| 7 | |
| 8 #include "ash/wm/window_resizer.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 | |
| 11 namespace gfx { | |
| 12 class Rect; | |
| 13 class Point; | |
| 14 } | |
| 15 | |
| 16 namespace ash { | |
| 17 | |
| 18 // DockWindowResizer is used by ToplevelWindowEventFilter to handle dragging, | |
| 19 // moving or resizing of a window while in dock. | |
|
stevenjb
2013/06/03 18:19:03
nit: 'in a dock'
varkha
2013/06/03 21:03:17
Done.
| |
| 20 class ASH_EXPORT DockWindowResizer : public WindowResizer { | |
| 21 public: | |
| 22 virtual ~DockWindowResizer(); | |
| 23 | |
| 24 // Creates a new DockWindowResizer. The caller takes ownership of the | |
| 25 // returned object. The ownership of |next_window_resizer| is taken by the | |
| 26 // returned object. Returns NULL if not resizable. | |
| 27 static DockWindowResizer* Create(WindowResizer* next_window_resizer, | |
| 28 aura::Window* window, | |
| 29 const gfx::Point& location, | |
| 30 int window_component); | |
| 31 | |
| 32 // WindowResizer overides: | |
|
stevenjb
2013/06/03 18:19:03
nit: There is a slight preference for override com
varkha
2013/06/03 21:03:17
Done.
| |
| 33 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE; | |
| 34 virtual void CompleteDrag(int event_flags) OVERRIDE; | |
| 35 virtual void RevertDrag() OVERRIDE; | |
| 36 virtual aura::Window* GetTarget() OVERRIDE; | |
| 37 | |
| 38 private: | |
| 39 // Creates DockWindowResizer that adds the ability to attach / detach | |
| 40 // windows to / from the dock. This object takes ownership of | |
| 41 // |next_window_resizer|. | |
| 42 DockWindowResizer(WindowResizer* next_window_resizer, | |
| 43 const Details& details); | |
|
stevenjb
2013/06/03 18:19:03
nit: align
varkha
2013/06/03 21:03:17
Done.
| |
| 44 | |
| 45 // Tracks the window's initial position and attachment at the start of a drag | |
| 46 // and informs the DockLayoutManager that a drag has started if necessary. | |
| 47 void StartedDragging(); | |
| 48 | |
| 49 // Informs the DockLayoutManager that the drag is complete if it was informed | |
| 50 // of the drag start. | |
| 51 void FinishDragging(); | |
| 52 | |
| 53 const Details details_; | |
| 54 | |
| 55 // Wraps a window resizer and adds detaching / reattaching during drags. | |
| 56 scoped_ptr<WindowResizer> next_window_resizer_; | |
| 57 | |
| 58 // Dock container window. | |
| 59 aura::Window* dock_container_; | |
| 60 | |
| 61 // Set to true once Drag() is invoked and the bounds of the window change. | |
| 62 bool did_move_or_resize_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(DockWindowResizer); | |
| 65 }; | |
| 66 | |
| 67 } // namespace aura | |
|
flackr
2013/06/03 22:03:43
s/aura/ash
This was probably wrong in panel_windo
varkha
2013/06/04 03:13:50
Done (both here and in panel_window_resizer.h).
| |
| 68 | |
| 69 #endif // ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ | |
| OLD | NEW |