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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 bool MaximizeModeWindowManager::ShouldHandleWindow(WmWindow* window) { | 259 bool MaximizeModeWindowManager::ShouldHandleWindow(WmWindow* window) { |
260 DCHECK(window); | 260 DCHECK(window); |
261 | 261 |
262 // Windows with the always-on-top property should be free-floating and thus | 262 // Windows with the always-on-top property should be free-floating and thus |
263 // not managed by us. | 263 // not managed by us. |
264 if (window->IsAlwaysOnTop()) | 264 if (window->IsAlwaysOnTop()) |
265 return false; | 265 return false; |
266 | 266 |
267 // If the changing bounds in the maximized/fullscreen is allowed, then | 267 // If the changing bounds in the maximized/fullscreen is allowed, then |
268 // let the client manage it even in maximized mode. | 268 // let the client manage it even in maximized mode. |
269 if (window->GetWindowState()->allow_set_bounds_in_maximized()) | 269 if (window->GetWindowState()->allow_set_bounds_direct()) |
270 return false; | 270 return false; |
271 | 271 |
272 return window->GetType() == ui::wm::WINDOW_TYPE_NORMAL; | 272 return window->GetType() == ui::wm::WINDOW_TYPE_NORMAL; |
273 } | 273 } |
274 | 274 |
275 void MaximizeModeWindowManager::AddWindowCreationObservers() { | 275 void MaximizeModeWindowManager::AddWindowCreationObservers() { |
276 DCHECK(observed_container_windows_.empty()); | 276 DCHECK(observed_container_windows_.empty()); |
277 // Observe window activations/creations in the default containers on all root | 277 // Observe window activations/creations in the default containers on all root |
278 // windows. | 278 // windows. |
279 for (aura::Window* root : Shell::Get()->GetAllRootWindows()) { | 279 for (aura::Window* root : Shell::Get()->GetAllRootWindows()) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 RootWindowController* controller = root->GetRootWindowController(); | 319 RootWindowController* controller = root->GetRootWindowController(); |
320 WmWindow* default_container = | 320 WmWindow* default_container = |
321 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); | 321 root->GetChildByShellWindowId(kShellWindowId_DefaultContainer); |
322 controller->workspace_controller()->SetMaximizeBackdropDelegate( | 322 controller->workspace_controller()->SetMaximizeBackdropDelegate( |
323 enable ? base::MakeUnique<WorkspaceBackdropDelegate>(default_container) | 323 enable ? base::MakeUnique<WorkspaceBackdropDelegate>(default_container) |
324 : nullptr); | 324 : nullptr); |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 } // namespace ash | 328 } // namespace ash |
OLD | NEW |