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 // WindowStateObserver overrides: | 60 // WindowStateObserver overrides: |
60 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, | 61 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, |
61 wm::WindowShowType old_type) OVERRIDE; | 62 wm::WindowShowType old_type) OVERRIDE; |
62 | 63 |
63 private: | 64 private: |
64 // Overridden from BaseLayoutManager: | 65 // Overridden from BaseLayoutManager: |
65 virtual void ShowStateChanged(wm::WindowState* window_state, | 66 virtual void ShowStateChanged(wm::WindowState* window_state, |
66 ui::WindowShowState last_show_state) OVERRIDE; | 67 ui::WindowShowState last_show_state) OVERRIDE; |
67 virtual void AdjustAllWindowsBoundsForWorkAreaChange( | 68 virtual void AdjustAllWindowsBoundsForWorkAreaChange( |
68 AdjustWindowReason reason) OVERRIDE; | 69 AdjustWindowReason reason) OVERRIDE; |
69 virtual void AdjustWindowBoundsForWorkAreaChange( | 70 virtual void AdjustWindowBoundsForWorkAreaChange( |
70 wm::WindowState* window_state, | 71 wm::WindowState* window_state, |
71 AdjustWindowReason reason) OVERRIDE; | 72 AdjustWindowReason reason) OVERRIDE; |
72 | 73 |
73 void AdjustWindowBoundsWhenAdded(wm::WindowState* window_state); | 74 void AdjustWindowBoundsWhenAdded(wm::WindowState* window_state); |
74 | 75 |
75 void UpdateDesktopVisibility(); | 76 // Updates the visibility state of the shelf. |
| 77 void UpdateShelfVisibility(); |
| 78 |
| 79 // Updates the fullscreen state of the workspace and notifies Shell if it |
| 80 // has changed. |
| 81 void UpdateFullscreenState(); |
76 | 82 |
77 // 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 |
78 // |last_show_state|. | 84 // |last_show_state|. |
79 void UpdateBoundsFromShowState(wm::WindowState* window_state, | 85 void UpdateBoundsFromShowState(wm::WindowState* window_state, |
80 ui::WindowShowState last_show_state); | 86 ui::WindowShowState last_show_state); |
81 | 87 |
82 // If |window_state| is maximized or fullscreen the bounds of the | 88 // If |window_state| is maximized or fullscreen the bounds of the |
83 // window are set and true is returned. Does nothing otherwise. | 89 // window are set and true is returned. Does nothing otherwise. |
84 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); | 90 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); |
85 | 91 |
86 // 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 |
87 // workspace if the window represented by |window_state| is side snapped. | 93 // workspace if the window represented by |window_state| is side snapped. |
88 void AdjustSnappedBounds(wm::WindowState* window_state, gfx::Rect* bounds); | 94 void AdjustSnappedBounds(wm::WindowState* window_state, gfx::Rect* bounds); |
89 | 95 |
90 // Animates the window bounds to |bounds|. | 96 // Animates the window bounds to |bounds|. |
91 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); | 97 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); |
92 | 98 |
93 internal::ShelfLayoutManager* shelf_; | 99 internal::ShelfLayoutManager* shelf_; |
94 aura::Window* window_; | 100 aura::Window* window_; |
95 | 101 |
96 // The work area. Cached to avoid unnecessarily moving windows during a | 102 // The work area. Cached to avoid unnecessarily moving windows during a |
97 // workspace switch. | 103 // workspace switch. |
98 gfx::Rect work_area_in_parent_; | 104 gfx::Rect work_area_in_parent_; |
99 | 105 |
| 106 // True if this workspace is currently in fullscreen mode. |
| 107 bool is_fullscreen_; |
| 108 |
100 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); | 109 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); |
101 }; | 110 }; |
102 | 111 |
103 } // namespace internal | 112 } // namespace internal |
104 } // namespace ash | 113 } // namespace ash |
105 | 114 |
106 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 115 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
OLD | NEW |