Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: ash/wm/dock/dock_window_resizer.h

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Docking with dock width=0 (more comments) Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 a dock.
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,
flackr 2013/06/04 19:58:10 This is the third resizer class to wrap another re
varkha 2013/06/07 19:01:28 Done (see TODO in workspace_window_resizer.cc).
28 aura::Window* window,
29 const gfx::Point& location,
30 int window_component);
31
32 // WindowResizer:
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);
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 ash
68
69 #endif // ASH_WM_DOCK_DOCK_WINDOW_RESIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698