| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "ash/shell_observer.h" | 10 #include "ash/shell_observer.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 virtual void SetChildBounds(aura::Window* child, | 48 virtual void SetChildBounds(aura::Window* child, |
| 49 const gfx::Rect& requested_bounds) OVERRIDE; | 49 const gfx::Rect& requested_bounds) OVERRIDE; |
| 50 | 50 |
| 51 // ash::ShellObserver overrides: | 51 // ash::ShellObserver overrides: |
| 52 virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE; | 52 virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE; |
| 53 | 53 |
| 54 // Overriden from WindowObserver: | 54 // Overriden from WindowObserver: |
| 55 virtual void OnWindowPropertyChanged(aura::Window* window, | 55 virtual void OnWindowPropertyChanged(aura::Window* window, |
| 56 const void* key, | 56 const void* key, |
| 57 intptr_t old) OVERRIDE; | 57 intptr_t old) OVERRIDE; |
| 58 virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE; |
| 58 | 59 |
| 59 // ash::WindowSettings::Observer overrides: | 60 // ash::WindowSettings::Observer overrides: |
| 60 virtual void OnTrackedByWorkspaceChanged(wm::WindowState* window_state, | 61 virtual void OnTrackedByWorkspaceChanged(wm::WindowState* window_state, |
| 61 bool old) OVERRIDE; | 62 bool old) OVERRIDE; |
| 62 | 63 |
| 63 // WindowStateObserver overrides: | 64 // WindowStateObserver overrides: |
| 64 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, | 65 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, |
| 65 wm::WindowShowType old_type) OVERRIDE; | 66 wm::WindowShowType old_type) OVERRIDE; |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 // Overridden from BaseLayoutManager: | 69 // Overridden from BaseLayoutManager: |
| 69 virtual void ShowStateChanged(wm::WindowState* window_state, | 70 virtual void ShowStateChanged(wm::WindowState* window_state, |
| 70 ui::WindowShowState last_show_state) OVERRIDE; | 71 ui::WindowShowState last_show_state) OVERRIDE; |
| 71 virtual void AdjustAllWindowsBoundsForWorkAreaChange( | 72 virtual void AdjustAllWindowsBoundsForWorkAreaChange( |
| 72 AdjustWindowReason reason) OVERRIDE; | 73 AdjustWindowReason reason) OVERRIDE; |
| 73 virtual void AdjustWindowBoundsForWorkAreaChange( | 74 virtual void AdjustWindowBoundsForWorkAreaChange( |
| 74 wm::WindowState* window_state, | 75 wm::WindowState* window_state, |
| 75 AdjustWindowReason reason) OVERRIDE; | 76 AdjustWindowReason reason) OVERRIDE; |
| 76 | 77 |
| 77 void AdjustWindowBoundsWhenAdded(wm::WindowState* window_state); | 78 void AdjustWindowBoundsWhenAdded(wm::WindowState* window_state); |
| 78 | 79 |
| 79 void UpdateDesktopVisibility(); | 80 void UpdateDesktopVisibility(); |
| 81 void UpdateFullscreenState(); |
| 80 | 82 |
| 81 // Updates the bounds of the window for a show state change from | 83 // Updates the bounds of the window for a show state change from |
| 82 // |last_show_state|. | 84 // |last_show_state|. |
| 83 void UpdateBoundsFromShowState(wm::WindowState* window_state, | 85 void UpdateBoundsFromShowState(wm::WindowState* window_state, |
| 84 ui::WindowShowState last_show_state); | 86 ui::WindowShowState last_show_state); |
| 85 | 87 |
| 86 // If |window_state| is maximized or fullscreen the bounds of the | 88 // If |window_state| is maximized or fullscreen the bounds of the |
| 87 // window are set and true is returned. Does nothing otherwise. | 89 // window are set and true is returned. Does nothing otherwise. |
| 88 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); | 90 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); |
| 89 | 91 |
| 90 // Adjusts the |bounds| so that they are flush with the edge of the | 92 // Adjusts the |bounds| so that they are flush with the edge of the |
| 91 // workspace if the window represented by |window_state| is side snapped. | 93 // workspace if the window represented by |window_state| is side snapped. |
| 92 void AdjustSnappedBounds(wm::WindowState* window_state, gfx::Rect* bounds); | 94 void AdjustSnappedBounds(wm::WindowState* window_state, gfx::Rect* bounds); |
| 93 | 95 |
| 94 // Animates the window bounds to |bounds|. | 96 // Animates the window bounds to |bounds|. |
| 95 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); | 97 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); |
| 96 | 98 |
| 97 internal::ShelfLayoutManager* shelf_; | 99 internal::ShelfLayoutManager* shelf_; |
| 98 aura::Window* window_; | 100 aura::Window* window_; |
| 99 | 101 |
| 100 // The work area. Cached to avoid unnecessarily moving windows during a | 102 // The work area. Cached to avoid unnecessarily moving windows during a |
| 101 // workspace switch. | 103 // workspace switch. |
| 102 gfx::Rect work_area_in_parent_; | 104 gfx::Rect work_area_in_parent_; |
| 103 | 105 |
| 106 // True if this workspace is currently in fullscreen mode. |
| 107 bool is_fullscreen_; |
| 108 |
| 104 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); | 109 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); |
| 105 }; | 110 }; |
| 106 | 111 |
| 107 } // namespace internal | 112 } // namespace internal |
| 108 } // namespace ash | 113 } // namespace ash |
| 109 | 114 |
| 110 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 115 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
| OLD | NEW |