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

Side by Side Diff: ash/wm/panels/panel_window_resizer.h

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dock with zero width (some tests disabled on Windows) 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_PANELS_PANEL_WINDOW_RESIZER_H_ 5 #ifndef ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_
6 #define ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_ 6 #define ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_
7 7
8 #include "ash/wm/window_resizer.h" 8 #include "ash/wm/window_resizer.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 10
(...skipping 12 matching lines...) Expand all
23 virtual ~PanelWindowResizer(); 23 virtual ~PanelWindowResizer();
24 24
25 // Creates a new PanelWindowResizer. The caller takes ownership of the 25 // Creates a new PanelWindowResizer. The caller takes ownership of the
26 // returned object. The ownership of |next_window_resizer| is taken by the 26 // returned object. The ownership of |next_window_resizer| is taken by the
27 // returned object. Returns NULL if not resizable. 27 // returned object. Returns NULL if not resizable.
28 static PanelWindowResizer* Create(WindowResizer* next_window_resizer, 28 static PanelWindowResizer* Create(WindowResizer* next_window_resizer,
29 aura::Window* window, 29 aura::Window* window,
30 const gfx::Point& location, 30 const gfx::Point& location,
31 int window_component); 31 int window_component);
32 32
33 // WindowResizer overides: 33 // WindowResizer:
34 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE; 34 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE;
35 virtual void CompleteDrag(int event_flags) OVERRIDE; 35 virtual void CompleteDrag(int event_flags) OVERRIDE;
36 virtual void RevertDrag() OVERRIDE; 36 virtual void RevertDrag() OVERRIDE;
37 virtual aura::Window* GetTarget() OVERRIDE; 37 virtual aura::Window* GetTarget() OVERRIDE;
38 38
39 const gfx::Point& GetInitialLocationInParentForTest() const { 39 const gfx::Point& GetInitialLocationInParentForTest() const {
40 return details_.initial_location_in_parent; 40 return details_.initial_location_in_parent;
41 } 41 }
42 42
43 private: 43 private:
(...skipping 14 matching lines...) Expand all
58 58
59 // Informs the PanelLayoutManager that the drag is complete if it was informed 59 // Informs the PanelLayoutManager that the drag is complete if it was informed
60 // of the drag start. 60 // of the drag start.
61 void FinishDragging(); 61 void FinishDragging();
62 62
63 // Updates the dragged panel's index in the launcher. 63 // Updates the dragged panel's index in the launcher.
64 void UpdateLauncherPosition(); 64 void UpdateLauncherPosition();
65 65
66 const Details details_; 66 const Details details_;
67 67
68 gfx::Point last_mouse_location_;
sky 2013/06/12 21:50:17 last_location_ (since not necessarily mouse).
varkha 2013/06/13 05:02:11 Done.
69
68 // Wraps a window resizer and adds panel detaching / reattaching and snapping 70 // Wraps a window resizer and adds panel detaching / reattaching and snapping
69 // to launcher behavior during drags. 71 // to launcher behavior during drags.
70 scoped_ptr<WindowResizer> next_window_resizer_; 72 scoped_ptr<WindowResizer> next_window_resizer_;
71 73
72 // Panel container window. 74 // Panel container window.
73 aura::Window* panel_container_; 75 aura::Window* panel_container_;
74 76
75 // Set to true once Drag() is invoked and the bounds of the window change. 77 // Set to true once Drag() is invoked and the bounds of the window change.
76 bool did_move_or_resize_; 78 bool did_move_or_resize_;
77 79
78 // True if the window started attached to the launcher. 80 // True if the window started attached to the launcher.
79 const bool was_attached_; 81 const bool was_attached_;
80 82
81 // True if the window should attach to the launcher after releasing. 83 // True if the window should attach to the launcher after releasing.
82 bool should_attach_; 84 bool should_attach_;
83 85
84 // If non-NULL the destructor sets this to true. Used to determine if this has 86 // If non-NULL the destructor sets this to true. Used to determine if this has
85 // been deleted. 87 // been deleted.
86 bool* destroyed_; 88 bool* destroyed_;
87 89
88 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizer); 90 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizer);
89 }; 91 };
90 92
91 } // namespace aura 93 } // namespace ash
92 94
93 #endif // ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_ 95 #endif // ASH_WM_PANELS_PANEL_WINDOW_RESIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698