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

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

Issue 597683003: Add window states docked; and docked minimized. Add wm window event to set docked and undocked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dock
Patch Set: Address Restore of App Windows and DockLeft/Dock Right issues Created 6 years, 2 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) 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_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 5 #ifndef ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
6 #define ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 6 #define ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/shelf/shelf_layout_manager_observer.h" 9 #include "ash/shelf/shelf_layout_manager_observer.h"
10 #include "ash/shell_observer.h" 10 #include "ash/shell_observer.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void DockDraggedWindow(aura::Window* window); 100 void DockDraggedWindow(aura::Window* window);
101 101
102 // Called by a DockedWindowResizer when a dragged window is no longer docked. 102 // Called by a DockedWindowResizer when a dragged window is no longer docked.
103 void UndockDraggedWindow(); 103 void UndockDraggedWindow();
104 104
105 // Called by a DockedWindowResizer when a window is no longer being dragged. 105 // Called by a DockedWindowResizer when a window is no longer being dragged.
106 // Stops observing the window unless it is a child. 106 // Stops observing the window unless it is a child.
107 // Records |action| by |source| in UMA. 107 // Records |action| by |source| in UMA.
108 void FinishDragging(DockedAction action, DockedActionSource source); 108 void FinishDragging(DockedAction action, DockedActionSource source);
109 109
110 void SetDockedAlignment(DockedAlignment desired_alignment);
varkha 2014/09/29 18:59:28 nit: Not sure if Set is the right name here since
dtapuska 2014/09/29 20:59:57 Done.
111
110 Shelf* shelf() { return shelf_; } 112 Shelf* shelf() { return shelf_; }
111 void SetShelf(Shelf* shelf); 113 void SetShelf(Shelf* shelf);
112 114
113 // Calculates if a window is touching the screen edges and returns edge. 115 // Calculates if a window is touching the screen edges and returns edge.
114 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; 116 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const;
115 117
116 // Used to snap docked windows to the side of screen during drag. 118 // Used to snap docked windows to the side of screen during drag.
117 DockedAlignment CalculateAlignment() const; 119 DockedAlignment CalculateAlignment() const;
118 120
119 // Returns true when a window can be docked. Windows cannot be docked at the 121 // Returns true when a window can be docked. Windows cannot be docked at the
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 class ShelfWindowObserver; 178 class ShelfWindowObserver;
177 friend class DockedWindowLayoutManagerTest; 179 friend class DockedWindowLayoutManagerTest;
178 friend class DockedWindowResizerTest; 180 friend class DockedWindowResizerTest;
179 181
180 // Width of the gap between the docked windows and a workspace. 182 // Width of the gap between the docked windows and a workspace.
181 static const int kMinDockGap; 183 static const int kMinDockGap;
182 184
183 // Ideal (starting) width of the dock. 185 // Ideal (starting) width of the dock.
184 static const int kIdealWidth; 186 static const int kIdealWidth;
185 187
188 DockedAlignment CalculateAlignment(const aura::Window* query_window) const;
varkha 2014/09/29 18:59:28 CalculateAlignment name is already used and is pub
dtapuska 2014/09/29 20:59:57 Done.
189
186 // Keep at most kMaxVisibleWindows visible in the dock and minimize the rest 190 // Keep at most kMaxVisibleWindows visible in the dock and minimize the rest
187 // (except for |child|). 191 // (except for |child|).
188 void MaybeMinimizeChildrenExcept(aura::Window* child); 192 void MaybeMinimizeChildrenExcept(aura::Window* child);
189 193
190 // Minimize / restore window and relayout. 194 // Minimize / restore window and relayout.
191 void MinimizeDockedWindow(wm::WindowState* window_state); 195 void MinimizeDockedWindow(wm::WindowState* window_state);
192 void RestoreDockedWindow(wm::WindowState* window_state); 196 void RestoreDockedWindow(wm::WindowState* window_state);
193 197
194 // Record user-initiated |action| by |source| in UMA metrics. 198 // Record user-initiated |action| by |source| in UMA metrics.
195 void RecordUmaAction(DockedAction action, DockedActionSource source); 199 void RecordUmaAction(DockedAction action, DockedActionSource source);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 307
304 // Observers of dock bounds changes. 308 // Observers of dock bounds changes.
305 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; 309 ObserverList<DockedWindowLayoutManagerObserver> observer_list_;
306 310
307 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); 311 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager);
308 }; 312 };
309 313
310 } // namespace ash 314 } // namespace ash
311 315
312 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 316 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698