Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2322)

Unified Diff: ash/wm/workspace_controller.cc

Issue 21966005: Removes workspace_animations.(h,cc) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/workspace/workspace_animations.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace_controller.cc
diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc
index 3e78097428eb62ea851caa690091d5145282ccc7..e2ee3f5c22272ea90ae6a622fc4105d050566941 100644
--- a/ash/wm/workspace_controller.cc
+++ b/ash/wm/workspace_controller.cc
@@ -9,15 +9,17 @@
#include "ash/shell_window_ids.h"
#include "ash/wm/base_layout_manager.h"
#include "ash/wm/property_util.h"
+#include "ash/wm/window_animations.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
-#include "ash/wm/workspace/workspace_animations.h"
#include "ash/wm/workspace/workspace_event_handler.h"
#include "ash/wm/workspace/workspace_layout_manager.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/compositor/layer.h"
+#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/views/corewm/visibility_controller.h"
#include "ui/views/corewm/window_animations.h"
@@ -94,10 +96,34 @@ void WorkspaceController::SetShelf(ShelfLayoutManager* shelf) {
}
void WorkspaceController::DoInitialAnimation() {
- WorkspaceAnimationDetails details;
- details.animate = details.animate_opacity = details.animate_scale = true;
- details.pause_time_ms = kInitialPauseTimeMS;
- ash::internal::ShowWorkspace(viewport_, details);
+ viewport_->Show();
+
+ viewport_->layer()->SetOpacity(0.0f);
+ SetTransformForScaleAnimation(
+ viewport_->layer(), LAYER_SCALE_ANIMATION_ABOVE);
+
+ // In order for pause to work we need to stop animations.
+ viewport_->layer()->GetAnimator()->StopAnimating();
+
+ {
+ ui::ScopedLayerAnimationSettings settings(
+ viewport_->layer()->GetAnimator());
+
+ settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
+ viewport_->layer()->GetAnimator()->SchedulePauseForProperties(
+ base::TimeDelta::FromMilliseconds(kInitialPauseTimeMS),
+ ui::LayerAnimationElement::TRANSFORM,
+ ui::LayerAnimationElement::OPACITY,
+ ui::LayerAnimationElement::BRIGHTNESS,
+ ui::LayerAnimationElement::VISIBILITY,
+ -1);
+
+ settings.SetTweenType(ui::Tween::EASE_OUT);
+ settings.SetTransitionDuration(
+ base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS));
+ viewport_->layer()->SetTransform(gfx::Transform());
+ viewport_->layer()->SetOpacity(1.0f);
+ }
}
} // namespace internal
« no previous file with comments | « ash/wm/workspace/workspace_animations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698