| 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_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const { | 56 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const { |
| 57 if (!viewport_) | 57 if (!viewport_) |
| 58 return wm::WORKSPACE_WINDOW_STATE_DEFAULT; | 58 return wm::WORKSPACE_WINDOW_STATE_DEFAULT; |
| 59 | 59 |
| 60 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_); | 60 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_); |
| 61 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf()) | 61 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf()) |
| 62 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 62 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
| 63 | 63 |
| 64 const gfx::Rect shelf_bounds(Shelf::ForWindow(viewport_)->GetIdealBounds()); | 64 const gfx::Rect shelf_bounds(Shelf::ForWindow(viewport_)->GetIdealBounds()); |
| 65 bool window_overlaps_launcher = false; | 65 bool window_overlaps_launcher = false; |
| 66 auto mru_list = Shell::Get()->mru_window_tracker()->BuildMruWindowList(); | 66 auto mru_list = |
| 67 Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); |
| 67 | 68 |
| 68 for (aura::Window* window : mru_list) { | 69 for (aura::Window* window : mru_list) { |
| 69 if (window->GetRootWindow() != viewport_->GetRootWindow()) | 70 if (window->GetRootWindow() != viewport_->GetRootWindow()) |
| 70 continue; | 71 continue; |
| 71 wm::WindowState* window_state = wm::GetWindowState(window); | 72 wm::WindowState* window_state = wm::GetWindowState(window); |
| 72 if (window_state->ignored_by_shelf() || | 73 if (window_state->ignored_by_shelf() || |
| 73 (window->layer() && !window->layer()->GetTargetVisibility())) { | 74 (window->layer() && !window->layer()->GetTargetVisibility())) { |
| 74 continue; | 75 continue; |
| 75 } | 76 } |
| 76 if (window_state->IsMaximized()) | 77 if (window_state->IsMaximized()) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 void WorkspaceController::OnWindowDestroying(aura::Window* window) { | 120 void WorkspaceController::OnWindowDestroying(aura::Window* window) { |
| 120 DCHECK_EQ(window, viewport_); | 121 DCHECK_EQ(window, viewport_); |
| 121 viewport_->RemoveObserver(this); | 122 viewport_->RemoveObserver(this); |
| 122 viewport_ = nullptr; | 123 viewport_ = nullptr; |
| 123 // Destroy |event_handler_| too as it depends upon |window|. | 124 // Destroy |event_handler_| too as it depends upon |window|. |
| 124 event_handler_.reset(); | 125 event_handler_.reset(); |
| 125 layout_manager_ = nullptr; | 126 layout_manager_ = nullptr; |
| 126 } | 127 } |
| 127 | 128 |
| 128 } // namespace ash | 129 } // namespace ash |
| OLD | NEW |