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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 | 111 |
| 112 Shelf* shelf() { return shelf_; } | 112 Shelf* shelf() { return shelf_; } |
| 113 void SetShelf(Shelf* shelf); | 113 void SetShelf(Shelf* shelf); |
| 114 | 114 |
| 115 // 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. |
| 116 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; | 116 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; |
| 117 | 117 |
| 118 // 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. |
| 119 DockedAlignment CalculateAlignment() const; | 119 DockedAlignment CalculateAlignment() const; |
| 120 | 120 |
| 121 // Set the preferred alignment of the dock | |
|
varkha
2014/09/29 21:04:34
s/Set/Sets.
nit: period at the end of the sentence
| |
| 122 void SetPreferredAlignment(DockedAlignment preferred_alignment); | |
| 123 | |
| 121 // 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 |
| 122 // edge used by the shelf or the edge opposite from existing dock. | 125 // edge used by the shelf or the edge opposite from existing dock. |
| 123 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); | 126 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); |
| 124 | 127 |
| 125 aura::Window* dock_container() const { return dock_container_; } | 128 aura::Window* dock_container() const { return dock_container_; } |
| 126 | 129 |
| 127 // Returns current bounding rectangle of docked windows area. | 130 // Returns current bounding rectangle of docked windows area. |
| 128 const gfx::Rect& docked_bounds() const { return docked_bounds_; } | 131 const gfx::Rect& docked_bounds() const { return docked_bounds_; } |
| 129 | 132 |
| 130 // Returns last known coordinates of |dragged_window_| after Relayout. | 133 // Returns last known coordinates of |dragged_window_| after Relayout. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 | 287 |
| 285 // Last bounds that were sent to observers. | 288 // Last bounds that were sent to observers. |
| 286 gfx::Rect docked_bounds_; | 289 gfx::Rect docked_bounds_; |
| 287 | 290 |
| 288 // Target bounds of a docked window being dragged. | 291 // Target bounds of a docked window being dragged. |
| 289 gfx::Rect dragged_bounds_; | 292 gfx::Rect dragged_bounds_; |
| 290 | 293 |
| 291 // Side of the screen that the dock is positioned at. | 294 // Side of the screen that the dock is positioned at. |
| 292 DockedAlignment alignment_; | 295 DockedAlignment alignment_; |
| 293 | 296 |
| 297 // The preferred alignment of the next window to be added. | |
| 298 DockedAlignment preferred_alignment_; | |
| 299 | |
| 294 // The last active window. Used to maintain stacking order even if no windows | 300 // The last active window. Used to maintain stacking order even if no windows |
| 295 // are currently focused. | 301 // are currently focused. |
| 296 aura::Window* last_active_window_; | 302 aura::Window* last_active_window_; |
| 297 | 303 |
| 298 // Timestamp of the last user-initiated action that changed docked state. | 304 // Timestamp of the last user-initiated action that changed docked state. |
| 299 // Used in UMA metrics. | 305 // Used in UMA metrics. |
| 300 base::Time last_action_time_; | 306 base::Time last_action_time_; |
| 301 | 307 |
| 302 // Observes shelf for bounds changes. | 308 // Observes shelf for bounds changes. |
| 303 scoped_ptr<ShelfWindowObserver> shelf_observer_; | 309 scoped_ptr<ShelfWindowObserver> shelf_observer_; |
| 304 | 310 |
| 305 // Widget used to paint a background for the docked area. | 311 // Widget used to paint a background for the docked area. |
| 306 scoped_ptr<DockedBackgroundWidget> background_widget_; | 312 scoped_ptr<DockedBackgroundWidget> background_widget_; |
| 307 | 313 |
| 308 // Observers of dock bounds changes. | 314 // Observers of dock bounds changes. |
| 309 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 315 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 310 | 316 |
| 311 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 317 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 312 }; | 318 }; |
| 313 | 319 |
| 314 } // namespace ash | 320 } // namespace ash |
| 315 | 321 |
| 316 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 322 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |