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

Unified Diff: ash/wm/window_animations.cc

Issue 11419225: Decouple workspace animation from other actions on windows (e.g. hide/show), so that animations can… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix doc Created 8 years, 1 month 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
Index: ash/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index d35e465936083865c1ed56f3679fbb95781d4f8a..6b2c3c27f15ffa8e004f7f5065b7172b91d1fabb 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -62,6 +62,10 @@ const float kWindowAnimation_MinimizeRotate = 0.f;
// Tween type when cross fading a workspace window.
const ui::Tween::Type kCrossFadeTweenType = ui::Tween::EASE_IN_OUT;
+// Scales for AshWindow above/below current workspace.
+const float kAshWindowScaleAbove = 1.1f;
Daniel Erat 2012/11/30 14:33:08 kLayerScaleAboveSize, kLayerScaleBelowSize
+const float kAshWindowScaleBelow = .9f;
+
int64 Round64(float f) {
return static_cast<int64>(f + 0.5f);
}
@@ -501,4 +505,16 @@ CreateBrightnessGrayscaleAnimationSequence(float target_value,
return animations;
}
+// Returns scale related to the specified AshWindowScaleType.
+void ApplyAshWindowAnimationScale(ui::Layer* layer,
+ AshWindowScaleType type) {
+ const float scale = type == ASH_WINDOW_SCALE_ABOVE ? kAshWindowScaleAbove :
+ kAshWindowScaleBelow;
+ gfx::Transform transform;
+ transform.Translate(-layer->bounds().width() * (scale - 1.0f) / 2,
+ -layer->bounds().height() * (scale - 1.0f) / 2);
+ transform.Scale(scale, scale);
+ layer->SetTransform(transform);
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698