Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_window_manager.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 29 matching lines...) Expand all
40 } // namespace 40 } // namespace
41 41
42 MaximizeModeWindowManager::~MaximizeModeWindowManager() { 42 MaximizeModeWindowManager::~MaximizeModeWindowManager() {
43 // Overview mode needs to be ended before exiting maximize mode to prevent 43 // Overview mode needs to be ended before exiting maximize mode to prevent
44 // transforming windows which are currently in 44 // transforming windows which are currently in
45 // overview: http://crbug.com/366605 45 // overview: http://crbug.com/366605
46 CancelOverview(); 46 CancelOverview();
47 47
48 Shell::GetInstance()->RemovePreTargetHandler(this); 48 Shell::GetInstance()->RemovePreTargetHandler(this);
49 Shell::GetInstance()->RemoveShellObserver(this); 49 Shell::GetInstance()->RemoveShellObserver(this);
50 Shell::GetScreen()->RemoveObserver(this); 50 gfx::Screen::GetScreen()->RemoveObserver(this);
51 EnableBackdropBehindTopWindowOnEachDisplay(false); 51 EnableBackdropBehindTopWindowOnEachDisplay(false);
52 RemoveWindowCreationObservers(); 52 RemoveWindowCreationObservers();
53 RestoreAllWindows(); 53 RestoreAllWindows();
54 } 54 }
55 55
56 int MaximizeModeWindowManager::GetNumberOfManagedWindows() { 56 int MaximizeModeWindowManager::GetNumberOfManagedWindows() {
57 return window_state_map_.size(); 57 return window_state_map_.size();
58 } 58 }
59 59
60 void MaximizeModeWindowManager::AddWindow(aura::Window* window) { 60 void MaximizeModeWindowManager::AddWindow(aura::Window* window) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 MaximizeModeWindowManager::MaximizeModeWindowManager() 189 MaximizeModeWindowManager::MaximizeModeWindowManager()
190 : backdrops_hidden_(false) { 190 : backdrops_hidden_(false) {
191 // The overview mode needs to be ended before the maximize mode is started. To 191 // The overview mode needs to be ended before the maximize mode is started. To
192 // guarantee the proper order, it will be turned off from here. 192 // guarantee the proper order, it will be turned off from here.
193 CancelOverview(); 193 CancelOverview();
194 194
195 MaximizeAllWindows(); 195 MaximizeAllWindows();
196 AddWindowCreationObservers(); 196 AddWindowCreationObservers();
197 EnableBackdropBehindTopWindowOnEachDisplay(true); 197 EnableBackdropBehindTopWindowOnEachDisplay(true);
198 Shell::GetScreen()->AddObserver(this); 198 gfx::Screen::GetScreen()->AddObserver(this);
199 Shell::GetInstance()->AddShellObserver(this); 199 Shell::GetInstance()->AddShellObserver(this);
200 Shell::GetInstance()->AddPreTargetHandler(this); 200 Shell::GetInstance()->AddPreTargetHandler(this);
201 } 201 }
202 202
203 void MaximizeModeWindowManager::MaximizeAllWindows() { 203 void MaximizeModeWindowManager::MaximizeAllWindows() {
204 MruWindowTracker::WindowList windows = ash::Shell::GetInstance()-> 204 MruWindowTracker::WindowList windows = ash::Shell::GetInstance()->
205 mru_window_tracker()->BuildWindowListIgnoreModal(); 205 mru_window_tracker()->BuildWindowListIgnoreModal();
206 // Add all existing Mru windows. 206 // Add all existing Mru windows.
207 for (MruWindowTracker::WindowList::iterator window = windows.begin(); 207 for (MruWindowTracker::WindowList::iterator window = windows.begin();
208 window != windows.end(); ++window) { 208 window != windows.end(); ++window) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 RootWindowController* controller = *iter; 324 RootWindowController* controller = *iter;
325 aura::Window* container = Shell::GetContainer( 325 aura::Window* container = Shell::GetContainer(
326 controller->GetRootWindow(), kShellWindowId_DefaultContainer); 326 controller->GetRootWindow(), kShellWindowId_DefaultContainer);
327 controller->workspace_controller()->SetMaximizeBackdropDelegate( 327 controller->workspace_controller()->SetMaximizeBackdropDelegate(
328 scoped_ptr<WorkspaceLayoutManagerDelegate>( 328 scoped_ptr<WorkspaceLayoutManagerDelegate>(
329 enable ? new WorkspaceBackdropDelegate(container) : NULL)); 329 enable ? new WorkspaceBackdropDelegate(container) : NULL));
330 } 330 }
331 } 331 }
332 332
333 } // namespace ash 333 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/lock_layout_manager_unittest.cc ('k') | ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698