| 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_controller.h" | 10 #include "ash/common/session/session_controller.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // always-on-top state change, because it is kept disabled regardless of | 313 // always-on-top state change, because it is kept disabled regardless of |
| 314 // the fullscreen state change. | 314 // the fullscreen state change. |
| 315 return; | 315 return; |
| 316 } | 316 } |
| 317 | 317 |
| 318 UpdateAlwaysOnTop(is_fullscreen_ ? wm::GetWindowForFullscreenMode(window_) | 318 UpdateAlwaysOnTop(is_fullscreen_ ? wm::GetWindowForFullscreenMode(window_) |
| 319 : nullptr); | 319 : nullptr); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void WorkspaceLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) { | 322 void WorkspaceLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) { |
| 323 if (!WmShell::Get()->IsPinned() && is_fullscreen_) { | 323 const bool is_pinned = WmShell::Get()->IsPinned(); |
| 324 if (!is_pinned && is_fullscreen_) { |
| 324 // On exiting from pinned mode, if the workspace is still in fullscreen | 325 // On exiting from pinned mode, if the workspace is still in fullscreen |
| 325 // mode, then this event does not trigger the restoring yet. On exiting | 326 // mode, then this event does not trigger the restoring yet. On exiting |
| 326 // from fullscreen, the temporarily disabled always-on-top property will be | 327 // from fullscreen, the temporarily disabled always-on-top property will be |
| 327 // restored. | 328 // restored. |
| 328 return; | 329 return; |
| 329 } | 330 } |
| 330 | 331 |
| 331 UpdateAlwaysOnTop(WmShell::Get()->IsPinned() ? pinned_window : nullptr); | 332 UpdateAlwaysOnTop(is_pinned ? pinned_window : nullptr); |
| 332 } | 333 } |
| 333 | 334 |
| 334 void WorkspaceLayoutManager::OnVirtualKeyboardStateChanged( | 335 void WorkspaceLayoutManager::OnVirtualKeyboardStateChanged( |
| 335 bool activated, | 336 bool activated, |
| 336 WmWindow* root_window) { | 337 WmWindow* root_window) { |
| 337 UpdateKeyboardObserverFromStateChanged(activated, root_window, root_window_, | 338 UpdateKeyboardObserverFromStateChanged(activated, root_window, root_window_, |
| 338 &keyboard_observer_); | 339 &keyboard_observer_); |
| 339 } | 340 } |
| 340 | 341 |
| 341 ////////////////////////////////////////////////////////////////////////////// | 342 ////////////////////////////////////////////////////////////////////////////// |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 for (auto* window : windows) { | 395 for (auto* window : windows) { |
| 395 wm::WindowState* window_state = window->GetWindowState(); | 396 wm::WindowState* window_state = window->GetWindowState(); |
| 396 if (window_on_top) | 397 if (window_on_top) |
| 397 window_state->DisableAlwaysOnTop(window_on_top); | 398 window_state->DisableAlwaysOnTop(window_on_top); |
| 398 else | 399 else |
| 399 window_state->RestoreAlwaysOnTop(); | 400 window_state->RestoreAlwaysOnTop(); |
| 400 } | 401 } |
| 401 } | 402 } |
| 402 | 403 |
| 403 } // namespace ash | 404 } // namespace ash |
| OLD | NEW |