| 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" |
| 11 #include "ash/wm/dock/dock_types.h" | 11 #include "ash/wm/dock/dock_types.h" |
| 12 #include "ash/wm/dock/docked_window_layout_manager_observer.h" | 12 #include "ash/wm/dock/docked_window_layout_manager_observer.h" |
| 13 #include "ash/wm/window_state_observer.h" | 13 #include "ash/wm/window_state_observer.h" |
| 14 #include "ash/wm/workspace/snap_types.h" | |
| 15 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 16 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 17 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 18 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 20 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 21 #include "ui/aura/layout_manager.h" | 20 #include "ui/aura/layout_manager.h" |
| 22 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 23 #include "ui/aura/window_observer.h" | 22 #include "ui/aura/window_observer.h" |
| 24 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void SetShelf(Shelf* shelf); | 111 void SetShelf(Shelf* shelf); |
| 113 | 112 |
| 114 // Calculates if a window is touching the screen edges and returns edge. | 113 // Calculates if a window is touching the screen edges and returns edge. |
| 115 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; | 114 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; |
| 116 | 115 |
| 117 // Used to snap docked windows to the side of screen during drag. | 116 // Used to snap docked windows to the side of screen during drag. |
| 118 DockedAlignment CalculateAlignment() const; | 117 DockedAlignment CalculateAlignment() const; |
| 119 | 118 |
| 120 // Returns true when a window can be docked. Windows cannot be docked at the | 119 // Returns true when a window can be docked. Windows cannot be docked at the |
| 121 // edge used by the shelf or the edge opposite from existing dock. | 120 // edge used by the shelf or the edge opposite from existing dock. |
| 122 bool CanDockWindow(aura::Window* window, SnapType edge); | 121 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); |
| 123 | 122 |
| 124 aura::Window* dock_container() const { return dock_container_; } | 123 aura::Window* dock_container() const { return dock_container_; } |
| 125 | 124 |
| 126 // Returns current bounding rectangle of docked windows area. | 125 // Returns current bounding rectangle of docked windows area. |
| 127 const gfx::Rect& docked_bounds() const { return docked_bounds_; } | 126 const gfx::Rect& docked_bounds() const { return docked_bounds_; } |
| 128 | 127 |
| 129 // Returns last known coordinates of |dragged_window_| after Relayout. | 128 // Returns last known coordinates of |dragged_window_| after Relayout. |
| 130 const gfx::Rect dragged_bounds() const { return dragged_bounds_;} | 129 const gfx::Rect dragged_bounds() const { return dragged_bounds_;} |
| 131 | 130 |
| 132 // Returns true if currently dragged window is docked at the screen edge. | 131 // Returns true if currently dragged window is docked at the screen edge. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 303 |
| 305 // Observers of dock bounds changes. | 304 // Observers of dock bounds changes. |
| 306 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 305 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 307 | 306 |
| 308 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 307 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 309 }; | 308 }; |
| 310 | 309 |
| 311 } // namespace ash | 310 } // namespace ash |
| 312 | 311 |
| 313 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 312 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |