| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // not managed by us. | 264 // not managed by us. |
| 265 if (window->IsAlwaysOnTop()) | 265 if (window->IsAlwaysOnTop()) |
| 266 return false; | 266 return false; |
| 267 | 267 |
| 268 // Windows in the dock should not be managed by us. | 268 // Windows in the dock should not be managed by us. |
| 269 if (window->GetWindowState()->IsDocked()) | 269 if (window->GetWindowState()->IsDocked()) |
| 270 return false; | 270 return false; |
| 271 | 271 |
| 272 // If the changing bounds in the maximized/fullscreen is allowed, then | 272 // If the changing bounds in the maximized/fullscreen is allowed, then |
| 273 // let the client manage it even in maximized mode. | 273 // let the client manage it even in maximized mode. |
| 274 if (window->GetWindowState()->allow_set_bounds_in_maximized()) | 274 if (window->GetWindowState()->allow_set_bounds_direct()) |
| 275 return false; | 275 return false; |
| 276 | 276 |
| 277 return window->GetType() == ui::wm::WINDOW_TYPE_NORMAL; | 277 return window->GetType() == ui::wm::WINDOW_TYPE_NORMAL; |
| 278 } | 278 } |
| 279 | 279 |
| 280 void MaximizeModeWindowManager::AddWindowCreationObservers() { | 280 void MaximizeModeWindowManager::AddWindowCreationObservers() { |
| 281 DCHECK(observed_container_windows_.empty()); | 281 DCHECK(observed_container_windows_.empty()); |
| 282 // Observe window activations/creations in the default containers on all root | 282 // Observe window activations/creations in the default containers on all root |
| 283 // windows. | 283 // windows. |
| 284 for (aura::Window* root : Shell::GetInstance()->GetAllRootWindows()) { | 284 for (aura::Window* root : Shell::GetInstance()->GetAllRootWindows()) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 RootWindowController* controller = root->GetRootWindowController(); | 324 RootWindowController* controller = root->GetRootWindowController(); |
| 325 WmWindow* default_container = | 325 WmWindow* default_container = |
| 326 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); | 326 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); |
| 327 controller->workspace_controller()->SetMaximizeBackdropDelegate( | 327 controller->workspace_controller()->SetMaximizeBackdropDelegate( |
| 328 enable ? base::MakeUnique<WorkspaceBackdropDelegate>(default_container) | 328 enable ? base::MakeUnique<WorkspaceBackdropDelegate>(default_container) |
| 329 : nullptr); | 329 : nullptr); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace ash | 333 } // namespace ash |
| OLD | NEW |