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 #include "ash/wm/base_layout_manager.h" | 5 #include "ash/wm/base_layout_manager.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 void BaseLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) { | 84 void BaseLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) { |
85 } | 85 } |
86 | 86 |
87 void BaseLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, | 87 void BaseLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, |
88 bool visible) { | 88 bool visible) { |
89 if (visible && wm::IsWindowMinimized(child)) { | 89 if (visible && wm::IsWindowMinimized(child)) { |
90 // Attempting to show a minimized window. Unminimize it. | 90 // Attempting to show a minimized window. Unminimize it. |
91 child->SetProperty(aura::client::kShowStateKey, | 91 child->SetProperty(aura::client::kShowStateKey, |
92 child->GetProperty(internal::kRestoreShowStateKey)); | 92 child->GetProperty(aura::client::kRestoreShowStateKey)); |
93 child->ClearProperty(internal::kRestoreShowStateKey); | 93 child->ClearProperty(aura::client::kRestoreShowStateKey); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void BaseLayoutManager::SetChildBounds(aura::Window* child, | 97 void BaseLayoutManager::SetChildBounds(aura::Window* child, |
98 const gfx::Rect& requested_bounds) { | 98 const gfx::Rect& requested_bounds) { |
99 gfx::Rect child_bounds(requested_bounds); | 99 gfx::Rect child_bounds(requested_bounds); |
100 // Some windows rely on this to set their initial bounds. | 100 // Some windows rely on this to set their initial bounds. |
101 if (wm::IsWindowMaximized(child)) | 101 if (wm::IsWindowMaximized(child)) |
102 child_bounds = ScreenAsh::GetMaximizedWindowBoundsInParent(child); | 102 child_bounds = ScreenAsh::GetMaximizedWindowBoundsInParent(child); |
103 else if (wm::IsWindowFullscreen(child)) | 103 else if (wm::IsWindowFullscreen(child)) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 ////////////////////////////////////////////////////////////////////////////// | 167 ////////////////////////////////////////////////////////////////////////////// |
168 // BaseLayoutManager, private: | 168 // BaseLayoutManager, private: |
169 | 169 |
170 void BaseLayoutManager::ShowStateChanged(aura::Window* window, | 170 void BaseLayoutManager::ShowStateChanged(aura::Window* window, |
171 ui::WindowShowState last_show_state) { | 171 ui::WindowShowState last_show_state) { |
172 if (wm::IsWindowMinimized(window)) { | 172 if (wm::IsWindowMinimized(window)) { |
173 // Save the previous show state so that we can correctly restore it. | 173 // Save the previous show state so that we can correctly restore it. |
174 window->SetProperty(internal::kRestoreShowStateKey, last_show_state); | 174 window->SetProperty(aura::client::kRestoreShowStateKey, last_show_state); |
175 views::corewm::SetWindowVisibilityAnimationType( | 175 views::corewm::SetWindowVisibilityAnimationType( |
176 window, WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); | 176 window, WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); |
177 | 177 |
178 // Hide the window. | 178 // Hide the window. |
179 window->Hide(); | 179 window->Hide(); |
180 // Activate another window. | 180 // Activate another window. |
181 if (wm::IsActiveWindow(window)) | 181 if (wm::IsActiveWindow(window)) |
182 wm::DeactivateWindow(window); | 182 wm::DeactivateWindow(window); |
183 } else if ((window->TargetVisibility() || | 183 } else if ((window->TargetVisibility() || |
184 last_show_state == ui::SHOW_STATE_MINIMIZED) && | 184 last_show_state == ui::SHOW_STATE_MINIMIZED) && |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // Put as much of the window as possible within the display area. | 245 // Put as much of the window as possible within the display area. |
246 gfx::Rect bounds = window->bounds(); | 246 gfx::Rect bounds = window->bounds(); |
247 bounds.AdjustToFit(display_rect); | 247 bounds.AdjustToFit(display_rect); |
248 window->SetBounds(bounds); | 248 window->SetBounds(bounds); |
249 } | 249 } |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 } // namespace internal | 253 } // namespace internal |
254 } // namespace ash | 254 } // namespace ash |
OLD | NEW |