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/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" | 10 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 MaximizeAllWindows(); | 176 MaximizeAllWindows(); |
177 AddWindowCreationObservers(); | 177 AddWindowCreationObservers(); |
178 EnableBackdropBehindTopWindowOnEachDisplay(true); | 178 EnableBackdropBehindTopWindowOnEachDisplay(true); |
179 Shell::GetScreen()->AddObserver(this); | 179 Shell::GetScreen()->AddObserver(this); |
180 Shell::GetInstance()->AddShellObserver(this); | 180 Shell::GetInstance()->AddShellObserver(this); |
181 Shell::GetInstance()->AddPreTargetHandler(this); | 181 Shell::GetInstance()->AddPreTargetHandler(this); |
182 } | 182 } |
183 | 183 |
184 void MaximizeModeWindowManager::MaximizeAllWindows() { | 184 void MaximizeModeWindowManager::MaximizeAllWindows() { |
185 MruWindowTracker::WindowList windows = | 185 MruWindowTracker::WindowList windows = MruWindowTracker::BuildWindowList(); |
186 MruWindowTracker::BuildWindowList(false); | |
187 // Add all existing Mru windows. | 186 // Add all existing Mru windows. |
188 for (MruWindowTracker::WindowList::iterator window = windows.begin(); | 187 for (MruWindowTracker::WindowList::iterator window = windows.begin(); |
189 window != windows.end(); ++window) { | 188 window != windows.end(); ++window) { |
190 MaximizeAndTrackWindow(*window); | 189 MaximizeAndTrackWindow(*window); |
191 } | 190 } |
192 } | 191 } |
193 | 192 |
194 void MaximizeModeWindowManager::RestoreAllWindows() { | 193 void MaximizeModeWindowManager::RestoreAllWindows() { |
195 while (window_state_map_.size()) | 194 while (window_state_map_.size()) |
196 ForgetWindow(window_state_map_.begin()->first); | 195 ForgetWindow(window_state_map_.begin()->first); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 RootWindowController* controller = *iter; | 287 RootWindowController* controller = *iter; |
289 aura::Window* container = Shell::GetContainer( | 288 aura::Window* container = Shell::GetContainer( |
290 controller->GetRootWindow(), kShellWindowId_DefaultContainer); | 289 controller->GetRootWindow(), kShellWindowId_DefaultContainer); |
291 controller->workspace_controller()->SetMaximizeBackdropDelegate( | 290 controller->workspace_controller()->SetMaximizeBackdropDelegate( |
292 scoped_ptr<WorkspaceLayoutManagerDelegate>( | 291 scoped_ptr<WorkspaceLayoutManagerDelegate>( |
293 enable ? new WorkspaceBackdropDelegate(container) : NULL)); | 292 enable ? new WorkspaceBackdropDelegate(container) : NULL)); |
294 } | 293 } |
295 } | 294 } |
296 | 295 |
297 } // namespace ash | 296 } // namespace ash |
OLD | NEW |