| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/maximize_mode/maximize_mode_window_manager.h" | 5 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" | 9 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" |
| 10 #include "ash/common/wm/maximize_mode/maximize_mode_window_state.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_window_state.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 MaximizeAllWindows(); | 205 MaximizeAllWindows(); |
| 206 AddWindowCreationObservers(); | 206 AddWindowCreationObservers(); |
| 207 EnableBackdropBehindTopWindowOnEachDisplay(true); | 207 EnableBackdropBehindTopWindowOnEachDisplay(true); |
| 208 display::Screen::GetScreen()->AddObserver(this); | 208 display::Screen::GetScreen()->AddObserver(this); |
| 209 Shell::GetInstance()->AddShellObserver(this); | 209 Shell::GetInstance()->AddShellObserver(this); |
| 210 event_handler_ = WmShell::Get()->CreateMaximizeModeEventHandler(); | 210 event_handler_ = WmShell::Get()->CreateMaximizeModeEventHandler(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void MaximizeModeWindowManager::MaximizeAllWindows() { | 213 void MaximizeModeWindowManager::MaximizeAllWindows() { |
| 214 MruWindowTracker::WindowList windows = | 214 MruWindowTracker::WindowList windows = |
| 215 WmShell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); | 215 Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); |
| 216 // Add all existing Mru windows. | 216 // Add all existing Mru windows. |
| 217 for (WmWindow* window : windows) | 217 for (WmWindow* window : windows) |
| 218 MaximizeAndTrackWindow(window); | 218 MaximizeAndTrackWindow(window); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void MaximizeModeWindowManager::RestoreAllWindows() { | 221 void MaximizeModeWindowManager::RestoreAllWindows() { |
| 222 while (window_state_map_.size()) | 222 while (window_state_map_.size()) |
| 223 ForgetWindow(window_state_map_.begin()->first); | 223 ForgetWindow(window_state_map_.begin()->first); |
| 224 } | 224 } |
| 225 | 225 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 RootWindowController* controller = root->GetRootWindowController(); | 323 RootWindowController* controller = root->GetRootWindowController(); |
| 324 WmWindow* default_container = | 324 WmWindow* default_container = |
| 325 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); | 325 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); |
| 326 controller->workspace_controller()->SetMaximizeBackdropDelegate( | 326 controller->workspace_controller()->SetMaximizeBackdropDelegate( |
| 327 enable ? base::MakeUnique<WorkspaceBackdropDelegate>(default_container) | 327 enable ? base::MakeUnique<WorkspaceBackdropDelegate>(default_container) |
| 328 : nullptr); | 328 : nullptr); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace ash | 332 } // namespace ash |
| OLD | NEW |