| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/workspace/workspace_layout_manager.h" | 5 #include "ash/common/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/keyboard/keyboard_observer_register.h" | 9 #include "ash/common/keyboard/keyboard_observer_register.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_controller.h" |
| 11 #include "ash/common/shelf/wm_shelf.h" | 11 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/wm/always_on_top_controller.h" | 12 #include "ash/common/wm/always_on_top_controller.h" |
| 13 #include "ash/common/wm/fullscreen_window_finder.h" | 13 #include "ash/common/wm/fullscreen_window_finder.h" |
| 14 #include "ash/common/wm/window_positioner.h" | 14 #include "ash/common/wm/window_positioner.h" |
| 15 #include "ash/common/wm/window_state.h" | 15 #include "ash/common/wm/window_state.h" |
| 16 #include "ash/common/wm/wm_event.h" | 16 #include "ash/common/wm/wm_event.h" |
| 17 #include "ash/common/wm/wm_screen_util.h" | 17 #include "ash/common/wm/wm_screen_util.h" |
| 18 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" | 18 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" |
| 19 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
| 20 #include "ash/common/wm_window.h" | 20 #include "ash/common/wm_window.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 const wm::WMEvent* event) { | 345 const wm::WMEvent* event) { |
| 346 DCHECK(event->type() == wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED || | 346 DCHECK(event->type() == wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED || |
| 347 event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); | 347 event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); |
| 348 | 348 |
| 349 work_area_in_parent_ = wm::GetDisplayWorkAreaBoundsInParent(window_); | 349 work_area_in_parent_ = wm::GetDisplayWorkAreaBoundsInParent(window_); |
| 350 | 350 |
| 351 // Don't do any adjustments of the insets while we are in screen locked mode. | 351 // Don't do any adjustments of the insets while we are in screen locked mode. |
| 352 // This would happen if the launcher was auto hidden before the login screen | 352 // This would happen if the launcher was auto hidden before the login screen |
| 353 // was shown and then gets shown when the login screen gets presented. | 353 // was shown and then gets shown when the login screen gets presented. |
| 354 if (event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED && | 354 if (event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED && |
| 355 shell_->GetSessionStateDelegate()->IsScreenLocked()) | 355 WmShell::Get()->session_controller()->IsScreenLocked()) |
| 356 return; | 356 return; |
| 357 | 357 |
| 358 // If a user plugs an external display into a laptop running Aura the | 358 // If a user plugs an external display into a laptop running Aura the |
| 359 // display size will change. Maximized windows need to resize to match. | 359 // display size will change. Maximized windows need to resize to match. |
| 360 // We also do this when developers running Aura on a desktop manually resize | 360 // We also do this when developers running Aura on a desktop manually resize |
| 361 // the host window. | 361 // the host window. |
| 362 // We also need to do this when the work area insets changes. | 362 // We also need to do this when the work area insets changes. |
| 363 for (WmWindow* window : windows_) | 363 for (WmWindow* window : windows_) |
| 364 window->GetWindowState()->OnWMEvent(event); | 364 window->GetWindowState()->OnWMEvent(event); |
| 365 } | 365 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 394 for (auto* window : windows) { | 394 for (auto* window : windows) { |
| 395 wm::WindowState* window_state = window->GetWindowState(); | 395 wm::WindowState* window_state = window->GetWindowState(); |
| 396 if (window_on_top) | 396 if (window_on_top) |
| 397 window_state->DisableAlwaysOnTop(window_on_top); | 397 window_state->DisableAlwaysOnTop(window_on_top); |
| 398 else | 398 else |
| 399 window_state->RestoreAlwaysOnTop(); | 399 window_state->RestoreAlwaysOnTop(); |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace ash | 403 } // namespace ash |
| OLD | NEW |