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/workspace/workspace_manager2.h" | 5 #include "ash/wm/workspace/workspace_manager2.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (!shelf_) | 162 if (!shelf_) |
163 return WORKSPACE_WINDOW_STATE_DEFAULT; | 163 return WORKSPACE_WINDOW_STATE_DEFAULT; |
164 | 164 |
165 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); | 165 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); |
166 const Window::Windows& windows(active_workspace_->window()->children()); | 166 const Window::Windows& windows(active_workspace_->window()->children()); |
167 bool window_overlaps_launcher = false; | 167 bool window_overlaps_launcher = false; |
168 bool has_maximized_window = false; | 168 bool has_maximized_window = false; |
169 for (Window::Windows::const_iterator i = windows.begin(); | 169 for (Window::Windows::const_iterator i = windows.begin(); |
170 i != windows.end(); ++i) { | 170 i != windows.end(); ++i) { |
171 ui::Layer* layer = (*i)->layer(); | 171 ui::Layer* layer = (*i)->layer(); |
172 if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f || | 172 if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f) |
173 (*i)->id() == kShellWindowId_DesktopBackgroundContainer) | |
174 continue; | 173 continue; |
175 if (wm::IsWindowMaximized(*i)) { | 174 if (wm::IsWindowMaximized(*i)) { |
176 // An untracked window may still be fullscreen so we keep iterating when | 175 // An untracked window may still be fullscreen so we keep iterating when |
177 // we hit a maximized window. | 176 // we hit a maximized window. |
178 has_maximized_window = true; | 177 has_maximized_window = true; |
179 } else if (wm::IsWindowFullscreen(*i)) { | 178 } else if (wm::IsWindowFullscreen(*i)) { |
180 return WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 179 return WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
181 } | 180 } |
182 if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds)) | 181 if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds)) |
183 window_overlaps_launcher = true; | 182 window_overlaps_launcher = true; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 Window* child) { | 405 Window* child) { |
407 if (workspace->ShouldMoveToPending()) | 406 if (workspace->ShouldMoveToPending()) |
408 MoveWorkspaceToPendingOrDelete(workspace, NULL, ANIMATE_NEW); | 407 MoveWorkspaceToPendingOrDelete(workspace, NULL, ANIMATE_NEW); |
409 } | 408 } |
410 | 409 |
411 void WorkspaceManager2::OnWorkspaceChildWindowVisibilityChanged( | 410 void WorkspaceManager2::OnWorkspaceChildWindowVisibilityChanged( |
412 Workspace2* workspace, | 411 Workspace2* workspace, |
413 Window* child) { | 412 Window* child) { |
414 if (workspace->ShouldMoveToPending()) | 413 if (workspace->ShouldMoveToPending()) |
415 MoveWorkspaceToPendingOrDelete(workspace, NULL, ANIMATE_NEW); | 414 MoveWorkspaceToPendingOrDelete(workspace, NULL, ANIMATE_NEW); |
| 415 else if (workspace == active_workspace_) |
| 416 UpdateShelfVisibility(); |
416 } | 417 } |
417 | 418 |
418 void WorkspaceManager2::OnWorkspaceWindowChildBoundsChanged( | 419 void WorkspaceManager2::OnWorkspaceWindowChildBoundsChanged( |
419 Workspace2* workspace, | 420 Workspace2* workspace, |
420 Window* child) { | 421 Window* child) { |
421 if (workspace == active_workspace_) | 422 if (workspace == active_workspace_) |
422 UpdateShelfVisibility(); | 423 UpdateShelfVisibility(); |
423 } | 424 } |
424 | 425 |
425 void WorkspaceManager2::OnWorkspaceWindowShowStateChanged( | 426 void WorkspaceManager2::OnWorkspaceWindowShowStateChanged( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 child, old_layer); | 469 child, old_layer); |
469 } else { | 470 } else { |
470 DCHECK(!old_layer); | 471 DCHECK(!old_layer); |
471 } | 472 } |
472 } | 473 } |
473 UpdateShelfVisibility(); | 474 UpdateShelfVisibility(); |
474 } | 475 } |
475 | 476 |
476 } // namespace internal | 477 } // namespace internal |
477 } // namespace ash | 478 } // namespace ash |
OLD | NEW |