| 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_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 11 #include "ash/shelf/wm_shelf.h" | 11 #include "ash/shelf/wm_shelf.h" |
| 12 #include "ash/shell_port.h" | 12 #include "ash/shell_port.h" |
| 13 #include "ash/wm/fullscreen_window_finder.h" | 13 #include "ash/wm/fullscreen_window_finder.h" |
| 14 #include "ash/wm/window_state.h" | 14 #include "ash/wm/window_state.h" |
| 15 #include "ash/wm/window_state_aura.h" | 15 #include "ash/wm/window_state_aura.h" |
| 16 #include "ash/wm/wm_window_animations.h" | 16 #include "ash/wm/wm_window_animations.h" |
| 17 #include "ash/wm/workspace/backdrop_controller.h" |
| 18 #include "ash/wm/workspace/backdrop_delegate.h" |
| 17 #include "ash/wm/workspace/workspace_event_handler.h" | 19 #include "ash/wm/workspace/workspace_event_handler.h" |
| 18 #include "ash/wm/workspace/workspace_layout_manager.h" | 20 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 19 #include "ash/wm/workspace/workspace_layout_manager_backdrop_delegate.h" | |
| 20 #include "ash/wm_window.h" | 21 #include "ash/wm_window.h" |
| 21 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
| 22 #include "ui/compositor/layer.h" | 23 #include "ui/compositor/layer.h" |
| 23 #include "ui/compositor/scoped_layer_animation_settings.h" | 24 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 24 | 25 |
| 25 namespace ash { | 26 namespace ash { |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 // Amount of time to pause before animating anything. Only used during initial | 29 // Amount of time to pause before animating anything. Only used during initial |
| 29 // animation (when logging in). | 30 // animation (when logging in). |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 ui::LayerAnimationElement::BRIGHTNESS | | 105 ui::LayerAnimationElement::BRIGHTNESS | |
| 105 ui::LayerAnimationElement::VISIBILITY); | 106 ui::LayerAnimationElement::VISIBILITY); |
| 106 settings.SetTweenType(gfx::Tween::EASE_OUT); | 107 settings.SetTweenType(gfx::Tween::EASE_OUT); |
| 107 settings.SetTransitionDuration( | 108 settings.SetTransitionDuration( |
| 108 base::TimeDelta::FromMilliseconds(kInitialAnimationDurationMS)); | 109 base::TimeDelta::FromMilliseconds(kInitialAnimationDurationMS)); |
| 109 layer->SetTransform(gfx::Transform()); | 110 layer->SetTransform(gfx::Transform()); |
| 110 layer->SetOpacity(1.0f); | 111 layer->SetOpacity(1.0f); |
| 111 } | 112 } |
| 112 } | 113 } |
| 113 | 114 |
| 114 void WorkspaceController::SetMaximizeBackdropDelegate( | 115 void WorkspaceController::SetBackdropDelegate( |
| 115 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate) { | 116 std::unique_ptr<BackdropDelegate> delegate) { |
| 116 layout_manager_->SetMaximizeBackdropDelegate(std::move(delegate)); | 117 layout_manager_->SetBackdropDelegate(std::move(delegate)); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void WorkspaceController::OnWindowDestroying(aura::Window* window) { | 120 void WorkspaceController::OnWindowDestroying(aura::Window* window) { |
| 120 DCHECK_EQ(window, viewport_); | 121 DCHECK_EQ(window, viewport_); |
| 121 viewport_->RemoveObserver(this); | 122 viewport_->RemoveObserver(this); |
| 122 viewport_ = nullptr; | 123 viewport_ = nullptr; |
| 123 // Destroy |event_handler_| too as it depends upon |window|. | 124 // Destroy |event_handler_| too as it depends upon |window|. |
| 124 event_handler_.reset(); | 125 event_handler_.reset(); |
| 125 layout_manager_ = nullptr; | 126 layout_manager_ = nullptr; |
| 126 } | 127 } |
| 127 | 128 |
| 128 } // namespace ash | 129 } // namespace ash |
| OLD | NEW |