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/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 70 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
71 virtual void OnWindowBoundsChanged(aura::Window* window, | 71 virtual void OnWindowBoundsChanged(aura::Window* window, |
72 const gfx::Rect& old_bounds, | 72 const gfx::Rect& old_bounds, |
73 const gfx::Rect& new_bounds) OVERRIDE; | 73 const gfx::Rect& new_bounds) OVERRIDE; |
74 | 74 |
75 // aura::client::ActivationChangeObserver overrides: | 75 // aura::client::ActivationChangeObserver overrides: |
76 virtual void OnWindowActivated(aura::Window* gained_active, | 76 virtual void OnWindowActivated(aura::Window* gained_active, |
77 aura::Window* lost_active) OVERRIDE; | 77 aura::Window* lost_active) OVERRIDE; |
78 | 78 |
79 // WindowStateObserver overrides: | 79 // WindowStateObserver overrides: |
80 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, | 80 virtual void OnPostWindowShowTypeChange(wm::WindowState* window_state, |
81 wm::WindowShowType old_type) OVERRIDE; | 81 wm::WindowShowType old_type) OVERRIDE; |
82 | 82 |
83 private: | 83 private: |
84 typedef std::set<aura::Window*> WindowSet; | 84 typedef std::set<aura::Window*> WindowSet; |
85 | 85 |
86 enum AdjustWindowReason { | 86 enum AdjustWindowReason { |
87 ADJUST_WINDOW_DISPLAY_SIZE_CHANGED, | 87 ADJUST_WINDOW_DISPLAY_SIZE_CHANGED, |
88 ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED, | 88 ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED, |
89 }; | 89 }; |
90 | 90 |
91 // Invoked from OnWindowShowTypeChanged(). | |
92 void ShowTypeChanged(wm::WindowState* window_state, | |
93 wm::WindowShowType last_show_type); | |
94 | |
95 // Adjusts the window's bounds when the display area changes for given | 91 // Adjusts the window's bounds when the display area changes for given |
96 // window. This happens when the display size, work area insets or | 92 // window. This happens when the display size, work area insets or |
97 // the display on which the window exists has changed. | 93 // the display on which the window exists has changed. |
98 // If this is called for a display size change (i.e. |reason| | 94 // If this is called for a display size change (i.e. |reason| |
99 // is ADJUST_WINDOW_DISPLAY_SIZE_CHANGED), the non-maximized/non-fullscreen | 95 // is ADJUST_WINDOW_DISPLAY_SIZE_CHANGED), the non-maximized/non-fullscreen |
100 // windows are readjusted to make sure the window is completely within the | 96 // windows are readjusted to make sure the window is completely within the |
101 // display region. Otherwise, it makes sure at least some parts of the window | 97 // display region. Otherwise, it makes sure at least some parts of the window |
102 // is on display. | 98 // is on display. |
103 void AdjustAllWindowsBoundsForWorkAreaChange(AdjustWindowReason reason); | 99 void AdjustAllWindowsBoundsForWorkAreaChange(AdjustWindowReason reason); |
104 | 100 |
(...skipping 13 matching lines...) Expand all Loading... |
118 | 114 |
119 // Updates the bounds of the window for a show type change from | 115 // Updates the bounds of the window for a show type change from |
120 // |old_show_type|. | 116 // |old_show_type|. |
121 void UpdateBoundsFromShowType(wm::WindowState* window_state, | 117 void UpdateBoundsFromShowType(wm::WindowState* window_state, |
122 wm::WindowShowType old_show_type); | 118 wm::WindowShowType old_show_type); |
123 | 119 |
124 // If |window_state| is maximized or fullscreen the bounds of the | 120 // If |window_state| is maximized or fullscreen the bounds of the |
125 // window are set and true is returned. Does nothing otherwise. | 121 // window are set and true is returned. Does nothing otherwise. |
126 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); | 122 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); |
127 | 123 |
128 // Adjusts the |bounds| so that they are flush with the edge of the | |
129 // workspace if the window represented by |window_state| is side snapped. | |
130 void AdjustSnappedBounds(wm::WindowState* window_state, gfx::Rect* bounds); | |
131 | |
132 // Animates the window bounds to |bounds|. | 124 // Animates the window bounds to |bounds|. |
133 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); | 125 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); |
134 | 126 |
135 internal::ShelfLayoutManager* shelf_; | 127 internal::ShelfLayoutManager* shelf_; |
136 aura::Window* window_; | 128 aura::Window* window_; |
137 aura::Window* root_window_; | 129 aura::Window* root_window_; |
138 | 130 |
139 // Set of windows we're listening to. | 131 // Set of windows we're listening to. |
140 WindowSet windows_; | 132 WindowSet windows_; |
141 | 133 |
142 // The work area in the coordinates of |window_|. | 134 // The work area in the coordinates of |window_|. |
143 gfx::Rect work_area_in_parent_; | 135 gfx::Rect work_area_in_parent_; |
144 | 136 |
145 // True if this workspace is currently in fullscreen mode. | 137 // True if this workspace is currently in fullscreen mode. |
146 bool is_fullscreen_; | 138 bool is_fullscreen_; |
147 | 139 |
148 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); | 140 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); |
149 }; | 141 }; |
150 | 142 |
151 } // namespace internal | 143 } // namespace internal |
152 } // namespace ash | 144 } // namespace ash |
153 | 145 |
154 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 146 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
OLD | NEW |