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

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

Issue 437213005: Fixing problem with the maximize mode where MultiProfile windows do not get properly handled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 6 years, 4 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 | Annotate | Revision Log
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/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
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())) {
63 return;
64 }
65
66 MaximizeAndTrackWindow(window);
67 }
68
57 void MaximizeModeWindowManager::WindowStateDestroyed(aura::Window* window) { 69 void MaximizeModeWindowManager::WindowStateDestroyed(aura::Window* window) {
58 // At this time ForgetWindow() should already have been called. If not, 70 // At this time ForgetWindow() should already have been called. If not,
59 // someone else must have replaced the "window manager's state object". 71 // someone else must have replaced the "window manager's state object".
60 DCHECK(!window->HasObserver(this)); 72 DCHECK(!window->HasObserver(this));
61 73
62 WindowToState::iterator it = window_state_map_.find(window); 74 WindowToState::iterator it = window_state_map_.find(window);
63 DCHECK(it != window_state_map_.end()); 75 DCHECK(it != window_state_map_.end());
64 window_state_map_.erase(it); 76 window_state_map_.erase(it);
65 } 77 }
66 78
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 RootWindowController* controller = *iter; 277 RootWindowController* controller = *iter;
266 aura::Window* container = Shell::GetContainer( 278 aura::Window* container = Shell::GetContainer(
267 controller->GetRootWindow(), kShellWindowId_DefaultContainer); 279 controller->GetRootWindow(), kShellWindowId_DefaultContainer);
268 controller->workspace_controller()->SetMaximizeBackdropDelegate( 280 controller->workspace_controller()->SetMaximizeBackdropDelegate(
269 scoped_ptr<WorkspaceLayoutManagerDelegate>( 281 scoped_ptr<WorkspaceLayoutManagerDelegate>(
270 enable ? new WorkspaceBackdropDelegate(container) : NULL)); 282 enable ? new WorkspaceBackdropDelegate(container) : NULL));
271 } 283 }
272 } 284 }
273 285
274 } // namespace ash 286 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698