| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 WorkspaceController::~WorkspaceController() { | 47 WorkspaceController::~WorkspaceController() { |
| 48 if (!viewport_) | 48 if (!viewport_) |
| 49 return; | 49 return; |
| 50 | 50 |
| 51 viewport_->RemoveObserver(this); | 51 viewport_->RemoveObserver(this); |
| 52 viewport_->SetLayoutManager(nullptr); | 52 viewport_->SetLayoutManager(nullptr); |
| 53 } | 53 } |
| 54 | 54 |
| 55 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const { | 55 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const { |
| 56 if (!viewport_ || !RootWindowController::ForWindow(viewport_)->HasShelf()) | 56 if (!viewport_) |
| 57 return wm::WORKSPACE_WINDOW_STATE_DEFAULT; | 57 return wm::WORKSPACE_WINDOW_STATE_DEFAULT; |
| 58 | 58 |
| 59 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_); | 59 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_); |
| 60 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf()) | 60 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf()) |
| 61 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 61 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
| 62 | 62 |
| 63 const gfx::Rect shelf_bounds( | 63 const gfx::Rect shelf_bounds( |
| 64 WmShelf::ForWindow(WmWindow::Get(viewport_))->GetIdealBounds()); | 64 WmShelf::ForWindow(WmWindow::Get(viewport_))->GetIdealBounds()); |
| 65 bool window_overlaps_launcher = false; | 65 bool window_overlaps_launcher = false; |
| 66 // The default container may contain windows that may overlap the launcher | 66 // The default container may contain windows that may overlap the launcher |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 void WorkspaceController::OnWindowDestroying(aura::Window* window) { | 119 void WorkspaceController::OnWindowDestroying(aura::Window* window) { |
| 120 DCHECK_EQ(window, viewport_); | 120 DCHECK_EQ(window, viewport_); |
| 121 viewport_->RemoveObserver(this); | 121 viewport_->RemoveObserver(this); |
| 122 viewport_ = nullptr; | 122 viewport_ = nullptr; |
| 123 // Destroy |event_handler_| too as it depends upon |window|. | 123 // Destroy |event_handler_| too as it depends upon |window|. |
| 124 event_handler_.reset(); | 124 event_handler_.reset(); |
| 125 layout_manager_ = nullptr; | 125 layout_manager_ = nullptr; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace ash | 128 } // namespace ash |
| OLD | NEW |