| 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/wm/maximize_mode/maximize_mode_window_manager.h" | 5 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| 10 #include "ash/common/wm/wm_event.h" | 11 #include "ash/common/wm/wm_event.h" |
| 11 #include "ash/root_window_controller.h" | 12 #include "ash/root_window_controller.h" |
| 12 #include "ash/session/session_state_delegate.h" | 13 #include "ash/session/session_state_delegate.h" |
| 13 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 14 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" | 15 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" |
| 15 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" | 16 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" |
| 16 #include "ash/wm/mru_window_tracker.h" | 17 #include "ash/wm/mru_window_tracker.h" |
| 17 #include "ash/wm/overview/window_selector_controller.h" | 18 #include "ash/wm/overview/window_selector_controller.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 EnableBackdropBehindTopWindowOnEachDisplay(true); | 217 EnableBackdropBehindTopWindowOnEachDisplay(true); |
| 217 display::Screen::GetScreen()->AddObserver(this); | 218 display::Screen::GetScreen()->AddObserver(this); |
| 218 Shell::GetInstance()->AddShellObserver(this); | 219 Shell::GetInstance()->AddShellObserver(this); |
| 219 Shell::GetInstance()->AddPreTargetHandler(this); | 220 Shell::GetInstance()->AddPreTargetHandler(this); |
| 220 } | 221 } |
| 221 | 222 |
| 222 void MaximizeModeWindowManager::MaximizeAllWindows() { | 223 void MaximizeModeWindowManager::MaximizeAllWindows() { |
| 223 MruWindowTracker::WindowList windows = ash::Shell::GetInstance()-> | 224 MruWindowTracker::WindowList windows = ash::Shell::GetInstance()-> |
| 224 mru_window_tracker()->BuildWindowListIgnoreModal(); | 225 mru_window_tracker()->BuildWindowListIgnoreModal(); |
| 225 // Add all existing Mru windows. | 226 // Add all existing Mru windows. |
| 226 for (MruWindowTracker::WindowList::iterator window = windows.begin(); | 227 for (WmWindow* window : windows) |
| 227 window != windows.end(); ++window) { | 228 MaximizeAndTrackWindow(WmWindowAura::GetAuraWindow(window)); |
| 228 MaximizeAndTrackWindow(*window); | |
| 229 } | |
| 230 } | 229 } |
| 231 | 230 |
| 232 void MaximizeModeWindowManager::RestoreAllWindows() { | 231 void MaximizeModeWindowManager::RestoreAllWindows() { |
| 233 while (window_state_map_.size()) | 232 while (window_state_map_.size()) |
| 234 ForgetWindow(window_state_map_.begin()->first); | 233 ForgetWindow(window_state_map_.begin()->first); |
| 235 } | 234 } |
| 236 | 235 |
| 237 void MaximizeModeWindowManager::SetDeferBoundsUpdates( | 236 void MaximizeModeWindowManager::SetDeferBoundsUpdates( |
| 238 bool defer_bounds_updates) { | 237 bool defer_bounds_updates) { |
| 239 for (WindowToState::iterator it = window_state_map_.begin(); | 238 for (WindowToState::iterator it = window_state_map_.begin(); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 RootWindowController* controller = *iter; | 342 RootWindowController* controller = *iter; |
| 344 aura::Window* container = Shell::GetContainer( | 343 aura::Window* container = Shell::GetContainer( |
| 345 controller->GetRootWindow(), kShellWindowId_DefaultContainer); | 344 controller->GetRootWindow(), kShellWindowId_DefaultContainer); |
| 346 controller->workspace_controller()->SetMaximizeBackdropDelegate( | 345 controller->workspace_controller()->SetMaximizeBackdropDelegate( |
| 347 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate>( | 346 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate>( |
| 348 enable ? new WorkspaceBackdropDelegate(container) : NULL)); | 347 enable ? new WorkspaceBackdropDelegate(container) : NULL)); |
| 349 } | 348 } |
| 350 } | 349 } |
| 351 | 350 |
| 352 } // namespace ash | 351 } // namespace ash |
| OLD | NEW |