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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 Shell::GetScreen()->RemoveObserver(this); | 47 Shell::GetScreen()->RemoveObserver(this); |
48 EnableBackdropBehindTopWindowOnEachDisplay(false); | 48 EnableBackdropBehindTopWindowOnEachDisplay(false); |
49 RemoveWindowCreationObservers(); | 49 RemoveWindowCreationObservers(); |
50 RestoreAllWindows(); | 50 RestoreAllWindows(); |
51 } | 51 } |
52 | 52 |
53 int MaximizeModeWindowManager::GetNumberOfManagedWindows() { | 53 int MaximizeModeWindowManager::GetNumberOfManagedWindows() { |
54 return window_state_map_.size(); | 54 return window_state_map_.size(); |
55 } | 55 } |
56 | 56 |
57 void MaximizeModeWindowManager::AddWindow(aura::Window* window) { | |
58 // Only add the window if it is a direct dependent of a container window | |
59 // and not yet tracked. | |
60 if (!ShouldHandleWindow(window) || | |
61 window_state_map_.find(window) != window_state_map_.end() || | |
62 !IsContainerWindow(window->parent())) | |
flackr
2014/08/05 18:10:11
nit: curlies { }.
Mr4D (OOO till 08-26)
2014/08/06 20:31:47
Done.
| |
63 return; | |
64 | |
65 MaximizeAndTrackWindow(window); | |
66 } | |
67 | |
57 void MaximizeModeWindowManager::WindowStateDestroyed(aura::Window* window) { | 68 void MaximizeModeWindowManager::WindowStateDestroyed(aura::Window* window) { |
58 // At this time ForgetWindow() should already have been called. If not, | 69 // At this time ForgetWindow() should already have been called. If not, |
59 // someone else must have replaced the "window manager's state object". | 70 // someone else must have replaced the "window manager's state object". |
60 DCHECK(!window->HasObserver(this)); | 71 DCHECK(!window->HasObserver(this)); |
61 | 72 |
62 WindowToState::iterator it = window_state_map_.find(window); | 73 WindowToState::iterator it = window_state_map_.find(window); |
63 DCHECK(it != window_state_map_.end()); | 74 DCHECK(it != window_state_map_.end()); |
64 window_state_map_.erase(it); | 75 window_state_map_.erase(it); |
65 } | 76 } |
66 | 77 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 RootWindowController* controller = *iter; | 276 RootWindowController* controller = *iter; |
266 aura::Window* container = Shell::GetContainer( | 277 aura::Window* container = Shell::GetContainer( |
267 controller->GetRootWindow(), kShellWindowId_DefaultContainer); | 278 controller->GetRootWindow(), kShellWindowId_DefaultContainer); |
268 controller->workspace_controller()->SetMaximizeBackdropDelegate( | 279 controller->workspace_controller()->SetMaximizeBackdropDelegate( |
269 scoped_ptr<WorkspaceLayoutManagerDelegate>( | 280 scoped_ptr<WorkspaceLayoutManagerDelegate>( |
270 enable ? new WorkspaceBackdropDelegate(container) : NULL)); | 281 enable ? new WorkspaceBackdropDelegate(container) : NULL)); |
271 } | 282 } |
272 } | 283 } |
273 | 284 |
274 } // namespace ash | 285 } // namespace ash |
OLD | NEW |