| 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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| 11 #include "ash/session/session_state_delegate.h" | 11 #include "ash/session/session_state_delegate.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/wm/always_on_top_controller.h" | 13 #include "ash/wm/always_on_top_controller.h" |
| 14 #include "ash/wm/common/wm_event.h" | 14 #include "ash/wm/common/wm_event.h" |
| 15 #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" | 15 #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" |
| 16 #include "ash/wm/window_animations.h" | 16 #include "ash/wm/window_animations.h" |
| 17 #include "ash/wm/window_positioner.h" | 17 #include "ash/wm/window_positioner.h" |
| 18 #include "ash/wm/window_properties.h" | 18 #include "ash/wm/window_properties.h" |
| 19 #include "ash/wm/window_state.h" | 19 #include "ash/wm/window_state.h" |
| 20 #include "ash/wm/window_state_aura.h" |
| 20 #include "ash/wm/window_util.h" | 21 #include "ash/wm/window_util.h" |
| 21 #include "ash/wm/workspace/workspace_layout_manager_backdrop_delegate.h" | 22 #include "ash/wm/workspace/workspace_layout_manager_backdrop_delegate.h" |
| 22 #include "ui/aura/client/aura_constants.h" | 23 #include "ui/aura/client/aura_constants.h" |
| 23 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_observer.h" | 25 #include "ui/aura/window_observer.h" |
| 25 #include "ui/base/ui_base_types.h" | 26 #include "ui/base/ui_base_types.h" |
| 26 #include "ui/compositor/layer.h" | 27 #include "ui/compositor/layer.h" |
| 27 #include "ui/events/event.h" | 28 #include "ui/events/event.h" |
| 28 #include "ui/gfx/screen.h" | 29 #include "ui/gfx/screen.h" |
| 29 #include "ui/keyboard/keyboard_controller_observer.h" | 30 #include "ui/keyboard/keyboard_controller_observer.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 ? GetRootWindowController(window_->GetRootWindow()) | 194 ? GetRootWindowController(window_->GetRootWindow()) |
| 194 ->GetWindowForFullscreenMode() | 195 ->GetWindowForFullscreenMode() |
| 195 : NULL; | 196 : NULL; |
| 196 // Changing always on top state may change window's parent. Iterate on a copy | 197 // Changing always on top state may change window's parent. Iterate on a copy |
| 197 // of |windows_| to avoid invalidating an iterator. Since both workspace and | 198 // of |windows_| to avoid invalidating an iterator. Since both workspace and |
| 198 // always_on_top containers' layouts are managed by this class all the | 199 // always_on_top containers' layouts are managed by this class all the |
| 199 // appropriate windows will be included in the iteration. | 200 // appropriate windows will be included in the iteration. |
| 200 WindowSet windows(windows_); | 201 WindowSet windows(windows_); |
| 201 for (auto window : windows) { | 202 for (auto window : windows) { |
| 202 wm::WindowState* window_state = wm::GetWindowState(window); | 203 wm::WindowState* window_state = wm::GetWindowState(window); |
| 203 if (is_fullscreen) | 204 if (is_fullscreen) { |
| 204 window_state->DisableAlwaysOnTop(fullscreen_window); | 205 window_state->DisableAlwaysOnTop( |
| 205 else | 206 wm::WmWindowAura::Get(fullscreen_window)); |
| 207 } else { |
| 206 window_state->RestoreAlwaysOnTop(); | 208 window_state->RestoreAlwaysOnTop(); |
| 209 } |
| 207 } | 210 } |
| 208 } | 211 } |
| 209 | 212 |
| 210 ////////////////////////////////////////////////////////////////////////////// | 213 ////////////////////////////////////////////////////////////////////////////// |
| 211 // WorkspaceLayoutManager, aura::WindowObserver implementation: | 214 // WorkspaceLayoutManager, aura::WindowObserver implementation: |
| 212 | 215 |
| 213 void WorkspaceLayoutManager::OnWindowHierarchyChanged( | 216 void WorkspaceLayoutManager::OnWindowHierarchyChanged( |
| 214 const WindowObserver::HierarchyChangeParams& params) { | 217 const WindowObserver::HierarchyChangeParams& params) { |
| 215 if (!wm::GetWindowState(params.target)->IsActive()) | 218 if (!wm::GetWindowState(params.target)->IsActive()) |
| 216 return; | 219 return; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 return; | 348 return; |
| 346 bool is_fullscreen = GetRootWindowController( | 349 bool is_fullscreen = GetRootWindowController( |
| 347 window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL; | 350 window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL; |
| 348 if (is_fullscreen != is_fullscreen_) { | 351 if (is_fullscreen != is_fullscreen_) { |
| 349 delegate_->OnFullscreenStateChanged(is_fullscreen); | 352 delegate_->OnFullscreenStateChanged(is_fullscreen); |
| 350 is_fullscreen_ = is_fullscreen; | 353 is_fullscreen_ = is_fullscreen; |
| 351 } | 354 } |
| 352 } | 355 } |
| 353 | 356 |
| 354 } // namespace ash | 357 } // namespace ash |
| OLD | NEW |