Chromium Code Reviews| Index: ash/wm/dock/dock_window_resizer.h |
| diff --git a/ash/wm/dock/dock_window_resizer.h b/ash/wm/dock/dock_window_resizer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f749f5cdd14ccebc480a9fc758e253ebe8a7f2ad |
| --- /dev/null |
| +++ b/ash/wm/dock/dock_window_resizer.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ |
| +#define ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ |
| + |
| +#include "ash/wm/window_resizer.h" |
| +#include "base/compiler_specific.h" |
| + |
| +namespace gfx { |
| +class Rect; |
| +class Point; |
| +} |
| + |
| +namespace ash { |
| + |
| +// DockWindowResizer is used by ToplevelWindowEventFilter to handle dragging, |
| +// 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.
|
| +class ASH_EXPORT DockWindowResizer : public WindowResizer { |
| + public: |
| + virtual ~DockWindowResizer(); |
| + |
| + // Creates a new DockWindowResizer. The caller takes ownership of the |
| + // returned object. The ownership of |next_window_resizer| is taken by the |
| + // returned object. Returns NULL if not resizable. |
| + static DockWindowResizer* Create(WindowResizer* next_window_resizer, |
| + aura::Window* window, |
| + const gfx::Point& location, |
| + int window_component); |
| + |
| + // 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.
|
| + virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE; |
| + virtual void CompleteDrag(int event_flags) OVERRIDE; |
| + virtual void RevertDrag() OVERRIDE; |
| + virtual aura::Window* GetTarget() OVERRIDE; |
| + |
| + private: |
| + // Creates DockWindowResizer that adds the ability to attach / detach |
| + // windows to / from the dock. This object takes ownership of |
| + // |next_window_resizer|. |
| + DockWindowResizer(WindowResizer* next_window_resizer, |
| + const Details& details); |
|
stevenjb
2013/06/03 18:19:03
nit: align
varkha
2013/06/03 21:03:17
Done.
|
| + |
| + // Tracks the window's initial position and attachment at the start of a drag |
| + // and informs the DockLayoutManager that a drag has started if necessary. |
| + void StartedDragging(); |
| + |
| + // Informs the DockLayoutManager that the drag is complete if it was informed |
| + // of the drag start. |
| + void FinishDragging(); |
| + |
| + const Details details_; |
| + |
| + // Wraps a window resizer and adds detaching / reattaching during drags. |
| + scoped_ptr<WindowResizer> next_window_resizer_; |
| + |
| + // Dock container window. |
| + aura::Window* dock_container_; |
| + |
| + // Set to true once Drag() is invoked and the bounds of the window change. |
| + bool did_move_or_resize_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DockWindowResizer); |
| +}; |
| + |
| +} // 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).
|
| + |
| +#endif // ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_ |