| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/session_state_delegate.h" | 9 #include "ash/session_state_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/wm/always_on_top_controller.h" | 11 #include "ash/wm/always_on_top_controller.h" |
| 12 #include "ash/wm/base_layout_manager.h" | 12 #include "ash/wm/base_layout_manager.h" |
| 13 #include "ash/wm/window_animations.h" | 13 #include "ash/wm/window_animations.h" |
| 14 #include "ash/wm/window_properties.h" | 14 #include "ash/wm/window_properties.h" |
| 15 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
| 16 #include "ash/wm/workspace/workspace.h" | 16 #include "ash/wm/workspace/workspace.h" |
| 17 #include "ash/wm/workspace/workspace_manager.h" | 17 #include "ash/wm/workspace/workspace_manager.h" |
| 18 #include "ash/wm/workspace/workspace_window_resizer.h" | 18 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 19 #include "base/auto_reset.h" | 19 #include "base/auto_reset.h" |
| 20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
| 21 #include "ui/aura/client/aura_constants.h" | 21 #include "ui/aura/client/aura_constants.h" |
| 22 #include "ui/aura/root_window.h" | 22 #include "ui/aura/root_window.h" |
| 23 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_observer.h" | 24 #include "ui/aura/window_observer.h" |
| 25 #include "ui/base/events/event.h" | 25 #include "ui/base/events/event.h" |
| 26 #include "ui/base/ui_base_types.h" | 26 #include "ui/base/ui_base_types.h" |
| 27 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 27 #include "ui/views/corewm/window_util.h" | 28 #include "ui/views/corewm/window_util.h" |
| 28 | 29 |
| 29 using aura::Window; | 30 using aura::Window; |
| 30 | 31 |
| 31 namespace ash { | 32 namespace ash { |
| 32 | 33 |
| 33 namespace internal { | 34 namespace internal { |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | 37 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // Set the restore rectangle to the previously set restore rectangle. | 228 // Set the restore rectangle to the previously set restore rectangle. |
| 228 if (!restore.IsEmpty()) | 229 if (!restore.IsEmpty()) |
| 229 SetRestoreBoundsInScreen(window, restore); | 230 SetRestoreBoundsInScreen(window, restore); |
| 230 } | 231 } |
| 231 | 232 |
| 232 if (key == internal::kWindowTrackedByWorkspaceKey && | 233 if (key == internal::kWindowTrackedByWorkspaceKey && |
| 233 GetTrackedByWorkspace(window)) { | 234 GetTrackedByWorkspace(window)) { |
| 234 workspace_manager()->OnTrackedByWorkspaceChanged(workspace_, window); | 235 workspace_manager()->OnTrackedByWorkspaceChanged(workspace_, window); |
| 235 } | 236 } |
| 236 | 237 |
| 238 if (key == internal::kWindowCanBeMaximizedByWorkspaceKey && |
| 239 ash::Shell::IsForcedMaximizeMode()) { |
| 240 // Since this flag can only be set after creation, but it is not dynamic, |
| 241 // we want this flag to be executed immediately without animations. |
| 242 scoped_ptr<ui::ScopedAnimationDurationScaleMode> animation_duration( |
| 243 new ui::ScopedAnimationDurationScaleMode( |
| 244 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
| 245 if (old) |
| 246 ash::wm::RestoreWindow(window); |
| 247 else |
| 248 ash::wm::MaximizeWindow(window); |
| 249 } |
| 250 |
| 237 if (key == aura::client::kAlwaysOnTopKey && | 251 if (key == aura::client::kAlwaysOnTopKey && |
| 238 window->GetProperty(aura::client::kAlwaysOnTopKey)) { | 252 window->GetProperty(aura::client::kAlwaysOnTopKey)) { |
| 239 internal::AlwaysOnTopController* controller = | 253 internal::AlwaysOnTopController* controller = |
| 240 window->GetRootWindow()->GetProperty( | 254 window->GetRootWindow()->GetProperty( |
| 241 internal::kAlwaysOnTopControllerKey); | 255 internal::kAlwaysOnTopControllerKey); |
| 242 controller->GetContainer(window)->AddChild(window); | 256 controller->GetContainer(window)->AddChild(window); |
| 243 } | 257 } |
| 244 } | 258 } |
| 245 | 259 |
| 246 void WorkspaceLayoutManager::OnWindowDestroying(aura::Window* window) { | 260 void WorkspaceLayoutManager::OnWindowDestroying(aura::Window* window) { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 400 } |
| 387 return false; | 401 return false; |
| 388 } | 402 } |
| 389 | 403 |
| 390 WorkspaceManager* WorkspaceLayoutManager::workspace_manager() { | 404 WorkspaceManager* WorkspaceLayoutManager::workspace_manager() { |
| 391 return workspace_->workspace_manager(); | 405 return workspace_->workspace_manager(); |
| 392 } | 406 } |
| 393 | 407 |
| 394 } // namespace internal | 408 } // namespace internal |
| 395 } // namespace ash | 409 } // namespace ash |
| OLD | NEW |