Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 // Request the desired dock alignment. The alginment adjustment may not | |
| 111 // be applied as it may not be available; for example if the shelf | |
| 112 // is in the requested place; the transformation won't be applied. | |
| 113 void RequestDesiredDockedAlignment(DockedAlignment desired_alignment); | |
|
varkha
2014/09/30 20:15:21
From the comment sounds like MaybeSetDesiredDocked
dtapuska
2014/10/01 15:01:34
Done.
| |
| 114 | |
| 110 Shelf* shelf() { return shelf_; } | 115 Shelf* shelf() { return shelf_; } |
| 111 void SetShelf(Shelf* shelf); | 116 void SetShelf(Shelf* shelf); |
| 112 | 117 |
| 113 // Calculates if a window is touching the screen edges and returns edge. | 118 // Calculates if a window is touching the screen edges and returns edge. |
| 114 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; | 119 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; |
| 115 | 120 |
| 116 // Used to snap docked windows to the side of screen during drag. | 121 // Used to snap docked windows to the side of screen during drag. |
| 117 DockedAlignment CalculateAlignment() const; | 122 DockedAlignment CalculateAlignment() const; |
| 118 | 123 |
| 119 // Returns true when a window can be docked. Windows cannot be docked at the | 124 // 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 Loading... | |
| 176 class ShelfWindowObserver; | 181 class ShelfWindowObserver; |
| 177 friend class DockedWindowLayoutManagerTest; | 182 friend class DockedWindowLayoutManagerTest; |
| 178 friend class DockedWindowResizerTest; | 183 friend class DockedWindowResizerTest; |
| 179 | 184 |
| 180 // Width of the gap between the docked windows and a workspace. | 185 // Width of the gap between the docked windows and a workspace. |
| 181 static const int kMinDockGap; | 186 static const int kMinDockGap; |
| 182 | 187 |
| 183 // Ideal (starting) width of the dock. | 188 // Ideal (starting) width of the dock. |
| 184 static const int kIdealWidth; | 189 static const int kIdealWidth; |
| 185 | 190 |
| 191 // Calculate the alignment of the dock; the children need to be traversed; | |
| 192 // and the |child| should be skipped in the calculation. The computed dock | |
| 193 // alignment is returned. | |
| 194 DockedAlignment CalculateDockedAlignmentExcept(const aura::Window* child) | |
|
varkha
2014/09/30 20:15:19
nit: How about CalculateAlignmentExcept?
nit: Calc
dtapuska
2014/10/01 15:01:34
Done.
| |
| 195 const; | |
| 196 | |
| 197 // Determine if the |desired_alignment| is applicable taking into account | |
|
varkha
2014/09/30 20:15:21
I think this is IsDockedAlignmentValid.
nits:
s/de
dtapuska
2014/10/01 15:01:34
Done.
| |
| 198 // the location of the shelf. | |
| 199 bool IsDockedAlignmentApplicable(DockedAlignment desired_alignment) const; | |
| 200 | |
| 186 // Keep at most kMaxVisibleWindows visible in the dock and minimize the rest | 201 // Keep at most kMaxVisibleWindows visible in the dock and minimize the rest |
| 187 // (except for |child|). | 202 // (except for |child|). |
| 188 void MaybeMinimizeChildrenExcept(aura::Window* child); | 203 void MaybeMinimizeChildrenExcept(aura::Window* child); |
| 189 | 204 |
| 190 // Minimize / restore window and relayout. | 205 // Minimize / restore window and relayout. |
| 191 void MinimizeDockedWindow(wm::WindowState* window_state); | 206 void MinimizeDockedWindow(wm::WindowState* window_state); |
| 192 void RestoreDockedWindow(wm::WindowState* window_state); | 207 void RestoreDockedWindow(wm::WindowState* window_state); |
| 193 | 208 |
| 194 // Record user-initiated |action| by |source| in UMA metrics. | 209 // Record user-initiated |action| by |source| in UMA metrics. |
| 195 void RecordUmaAction(DockedAction action, DockedActionSource source); | 210 void RecordUmaAction(DockedAction action, DockedActionSource source); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 | 318 |
| 304 // Observers of dock bounds changes. | 319 // Observers of dock bounds changes. |
| 305 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 320 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 306 | 321 |
| 307 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 322 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 308 }; | 323 }; |
| 309 | 324 |
| 310 } // namespace ash | 325 } // namespace ash |
| 311 | 326 |
| 312 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 327 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |