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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 | 114 |
| 115 Shelf* shelf() { return shelf_; } | 115 Shelf* shelf() { return shelf_; } |
| 116 void SetShelf(Shelf* shelf); | 116 void SetShelf(Shelf* shelf); |
| 117 | 117 |
| 118 // 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. |
| 119 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; | 119 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; |
| 120 | 120 |
| 121 // 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. |
| 122 DockedAlignment CalculateAlignment() const; | 122 DockedAlignment CalculateAlignment() const; |
| 123 | 123 |
| 124 void set_preferred_alignment(DockedAlignment preferred_alignment) { | |
| 125 preferred_alignment_ = preferred_alignment; | |
| 126 } | |
| 127 | |
| 124 // Returns true when a window can be docked. Windows cannot be docked at the | 128 // Returns true when a window can be docked. Windows cannot be docked at the |
| 125 // edge used by the shelf or the edge opposite from existing dock. | 129 // edge used by the shelf or the edge opposite from existing dock. |
| 126 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); | 130 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); |
| 127 | 131 |
| 128 aura::Window* dock_container() const { return dock_container_; } | 132 aura::Window* dock_container() const { return dock_container_; } |
| 129 | 133 |
| 130 // Returns current bounding rectangle of docked windows area. | 134 // Returns current bounding rectangle of docked windows area. |
| 131 const gfx::Rect& docked_bounds() const { return docked_bounds_; } | 135 const gfx::Rect& docked_bounds() const { return docked_bounds_; } |
| 132 | 136 |
| 133 // Returns last known coordinates of |dragged_window_| after Relayout. | 137 // Returns last known coordinates of |dragged_window_| after Relayout. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 | 296 |
| 293 // Last bounds that were sent to observers. | 297 // Last bounds that were sent to observers. |
| 294 gfx::Rect docked_bounds_; | 298 gfx::Rect docked_bounds_; |
| 295 | 299 |
| 296 // Target bounds of a docked window being dragged. | 300 // Target bounds of a docked window being dragged. |
| 297 gfx::Rect dragged_bounds_; | 301 gfx::Rect dragged_bounds_; |
| 298 | 302 |
| 299 // Side of the screen that the dock is positioned at. | 303 // Side of the screen that the dock is positioned at. |
| 300 DockedAlignment alignment_; | 304 DockedAlignment alignment_; |
| 301 | 305 |
| 306 // The preferred alignment of the next window to be added. | |
|
varkha
2014/10/01 19:08:51
nit: s/added/docked or s/added/'added to docked la
dtapuska
2014/10/01 20:17:42
Done.
| |
| 307 DockedAlignment preferred_alignment_; | |
| 308 | |
| 302 // The last active window. Used to maintain stacking order even if no windows | 309 // The last active window. Used to maintain stacking order even if no windows |
| 303 // are currently focused. | 310 // are currently focused. |
| 304 aura::Window* last_active_window_; | 311 aura::Window* last_active_window_; |
| 305 | 312 |
| 306 // Timestamp of the last user-initiated action that changed docked state. | 313 // Timestamp of the last user-initiated action that changed docked state. |
| 307 // Used in UMA metrics. | 314 // Used in UMA metrics. |
| 308 base::Time last_action_time_; | 315 base::Time last_action_time_; |
| 309 | 316 |
| 310 // Observes shelf for bounds changes. | 317 // Observes shelf for bounds changes. |
| 311 scoped_ptr<ShelfWindowObserver> shelf_observer_; | 318 scoped_ptr<ShelfWindowObserver> shelf_observer_; |
| 312 | 319 |
| 313 // Widget used to paint a background for the docked area. | 320 // Widget used to paint a background for the docked area. |
| 314 scoped_ptr<DockedBackgroundWidget> background_widget_; | 321 scoped_ptr<DockedBackgroundWidget> background_widget_; |
| 315 | 322 |
| 316 // Observers of dock bounds changes. | 323 // Observers of dock bounds changes. |
| 317 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 324 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 318 | 325 |
| 319 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 326 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 320 }; | 327 }; |
| 321 | 328 |
| 322 } // namespace ash | 329 } // namespace ash |
| 323 | 330 |
| 324 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 331 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |