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/common/wm/workspace_controller.h" | 5 #include "ash/common/wm/workspace_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 const WmWindow* fullscreen = wm::GetWindowForFullscreenMode(viewport_); | 58 const WmWindow* fullscreen = wm::GetWindowForFullscreenMode(viewport_); |
59 if (fullscreen && !fullscreen->GetWindowState()->ignored_by_shelf()) | 59 if (fullscreen && !fullscreen->GetWindowState()->ignored_by_shelf()) |
60 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 60 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
61 | 61 |
62 // These are the container ids of containers which may contain windows that | 62 // These are the container ids of containers which may contain windows that |
63 // may overlap the launcher shelf and affect its transparency. | 63 // may overlap the launcher shelf and affect its transparency. |
64 const int kWindowContainerIds[] = { | 64 const int kWindowContainerIds[] = { |
65 kShellWindowId_DefaultContainer, kShellWindowId_DockedContainer, | 65 kShellWindowId_DefaultContainer, kShellWindowId_DockedContainer, |
66 }; | 66 }; |
67 const gfx::Rect shelf_bounds( | 67 const gfx::Rect shelf_bounds(WmShelf::ForWindow(viewport_)->GetIdealBounds()); |
68 viewport_->GetRootWindowController()->GetShelf()->GetIdealBounds()); | |
69 bool window_overlaps_launcher = false; | 68 bool window_overlaps_launcher = false; |
70 for (size_t i = 0; i < arraysize(kWindowContainerIds); i++) { | 69 for (size_t i = 0; i < arraysize(kWindowContainerIds); i++) { |
71 WmWindow* container = viewport_->GetRootWindow()->GetChildByShellWindowId( | 70 WmWindow* container = viewport_->GetRootWindow()->GetChildByShellWindowId( |
72 kWindowContainerIds[i]); | 71 kWindowContainerIds[i]); |
73 for (WmWindow* window : container->GetChildren()) { | 72 for (WmWindow* window : container->GetChildren()) { |
74 wm::WindowState* window_state = window->GetWindowState(); | 73 wm::WindowState* window_state = window->GetWindowState(); |
75 if (window_state->ignored_by_shelf() || | 74 if (window_state->ignored_by_shelf() || |
76 (window->GetLayer() && !window->GetLayer()->GetTargetVisibility())) { | 75 (window->GetLayer() && !window->GetLayer()->GetTargetVisibility())) { |
77 continue; | 76 continue; |
78 } | 77 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 124 |
126 void WorkspaceController::OnWindowDestroying(WmWindow* window) { | 125 void WorkspaceController::OnWindowDestroying(WmWindow* window) { |
127 DCHECK_EQ(window, viewport_); | 126 DCHECK_EQ(window, viewport_); |
128 viewport_->RemoveObserver(this); | 127 viewport_->RemoveObserver(this); |
129 viewport_ = nullptr; | 128 viewport_ = nullptr; |
130 // Destroy |event_handler_| too as it depends upon |window|. | 129 // Destroy |event_handler_| too as it depends upon |window|. |
131 event_handler_.reset(); | 130 event_handler_.reset(); |
132 } | 131 } |
133 | 132 |
134 } // namespace ash | 133 } // namespace ash |
OLD | NEW |