| 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/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
| 10 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 // Windows with the always-on-top property should be free-floating and thus | 221 // Windows with the always-on-top property should be free-floating and thus |
| 222 // not managed by us. | 222 // not managed by us. |
| 223 if (window->IsAlwaysOnTop()) | 223 if (window->IsAlwaysOnTop()) |
| 224 return false; | 224 return false; |
| 225 | 225 |
| 226 // Windows in the dock should not be managed by us. | 226 // Windows in the dock should not be managed by us. |
| 227 if (window->GetWindowState()->IsDocked()) | 227 if (window->GetWindowState()->IsDocked()) |
| 228 return false; | 228 return false; |
| 229 | 229 |
| 230 // If the changing bounds in the maximized/fullscreen is allowed, then |
| 231 // let the client manage it even in maximized mode. |
| 232 if (window->GetWindowState()->allow_set_bounds_in_maximized()) |
| 233 return false; |
| 234 |
| 230 return window->GetType() == ui::wm::WINDOW_TYPE_NORMAL; | 235 return window->GetType() == ui::wm::WINDOW_TYPE_NORMAL; |
| 231 } | 236 } |
| 232 | 237 |
| 233 void MaximizeModeWindowManager::AddWindowCreationObservers() { | 238 void MaximizeModeWindowManager::AddWindowCreationObservers() { |
| 234 DCHECK(observed_container_windows_.empty()); | 239 DCHECK(observed_container_windows_.empty()); |
| 235 // Observe window activations/creations in the default containers on all root | 240 // Observe window activations/creations in the default containers on all root |
| 236 // windows. | 241 // windows. |
| 237 for (WmWindow* root : WmShell::Get()->GetAllRootWindows()) { | 242 for (WmWindow* root : WmShell::Get()->GetAllRootWindows()) { |
| 238 WmWindow* default_container = | 243 WmWindow* default_container = |
| 239 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); | 244 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 for (WmWindow* root : WmShell::Get()->GetAllRootWindows()) { | 281 for (WmWindow* root : WmShell::Get()->GetAllRootWindows()) { |
| 277 WmRootWindowController* controller = root->GetRootWindowController(); | 282 WmRootWindowController* controller = root->GetRootWindowController(); |
| 278 WmWindow* default_container = | 283 WmWindow* default_container = |
| 279 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); | 284 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); |
| 280 controller->SetMaximizeBackdropDelegate(base::WrapUnique( | 285 controller->SetMaximizeBackdropDelegate(base::WrapUnique( |
| 281 enable ? new WorkspaceBackdropDelegate(default_container) : nullptr)); | 286 enable ? new WorkspaceBackdropDelegate(default_container) : nullptr)); |
| 282 } | 287 } |
| 283 } | 288 } |
| 284 | 289 |
| 285 } // namespace ash | 290 } // namespace ash |
| OLD | NEW |