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 30 matching lines...) Expand all Loading... |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 MaximizeModeWindowManager::~MaximizeModeWindowManager() { | 43 MaximizeModeWindowManager::~MaximizeModeWindowManager() { |
44 // Overview mode needs to be ended before exiting maximize mode to prevent | 44 // Overview mode needs to be ended before exiting maximize mode to prevent |
45 // transforming windows which are currently in | 45 // transforming windows which are currently in |
46 // overview: http://crbug.com/366605 | 46 // overview: http://crbug.com/366605 |
47 CancelOverview(); | 47 CancelOverview(); |
48 for (aura::Window* window : added_windows_) | 48 for (aura::Window* window : added_windows_) |
49 window->RemoveObserver(this); | 49 window->RemoveObserver(this); |
50 added_windows_.clear(); | 50 added_windows_.clear(); |
51 WmShell::Get()->RemoveShellObserver(this); | 51 Shell::GetInstance()->RemoveShellObserver(this); |
52 display::Screen::GetScreen()->RemoveObserver(this); | 52 display::Screen::GetScreen()->RemoveObserver(this); |
53 EnableBackdropBehindTopWindowOnEachDisplay(false); | 53 EnableBackdropBehindTopWindowOnEachDisplay(false); |
54 RemoveWindowCreationObservers(); | 54 RemoveWindowCreationObservers(); |
55 RestoreAllWindows(); | 55 RestoreAllWindows(); |
56 } | 56 } |
57 | 57 |
58 int MaximizeModeWindowManager::GetNumberOfManagedWindows() { | 58 int MaximizeModeWindowManager::GetNumberOfManagedWindows() { |
59 return window_state_map_.size(); | 59 return window_state_map_.size(); |
60 } | 60 } |
61 | 61 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 MaximizeModeWindowManager::MaximizeModeWindowManager() | 199 MaximizeModeWindowManager::MaximizeModeWindowManager() |
200 : backdrops_hidden_(false) { | 200 : backdrops_hidden_(false) { |
201 // The overview mode needs to be ended before the maximize mode is started. To | 201 // The overview mode needs to be ended before the maximize mode is started. To |
202 // guarantee the proper order, it will be turned off from here. | 202 // guarantee the proper order, it will be turned off from here. |
203 CancelOverview(); | 203 CancelOverview(); |
204 | 204 |
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 WmShell::Get()->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 WmShell::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 } |
(...skipping 103 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 |