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