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

Unified Diff: ash/wm/window_animations.cc

Issue 139013006: Revert 245031 "This CL" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1795/src/
Patch Set: Created 6 years, 11 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/dock/docked_window_layout_manager.cc ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_animations.cc
===================================================================
--- ash/wm/window_animations.cc (revision 245869)
+++ ash/wm/window_animations.cc (working copy)
@@ -71,9 +71,7 @@
const int kCrossFadeDurationMS = 200;
-void AddLayerAnimationsForMinimize(aura::Window* window,
- const base::TimeDelta& duration,
- bool show) {
+void AddLayerAnimationsForMinimize(aura::Window* window, bool show) {
// Recalculate the transform at restore time since the launcher item may have
// moved while the window was minimized.
gfx::Rect bounds = window->bounds();
@@ -107,6 +105,9 @@
rotation_about_pivot->SetReversed(show);
+ base::TimeDelta duration = window->layer()->GetAnimator()->
+ GetTransitionDuration();
+
scoped_ptr<ui::LayerAnimationElement> transition(
ui::LayerAnimationElement::CreateInterpolatedTransformElement(
rotation_about_pivot.release(), duration));
@@ -136,11 +137,10 @@
window->layer()->set_delegate(window);
window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
- base::TimeDelta duration = views::corewm::GetWindowShowAnimationDuration(
- window,
- base::TimeDelta::FromMilliseconds(kLayerAnimationsForMinimizeDurationMS));
+ base::TimeDelta duration = base::TimeDelta::FromMilliseconds(
+ kLayerAnimationsForMinimizeDurationMS);
settings.SetTransitionDuration(duration);
- AddLayerAnimationsForMinimize(window, duration, true);
+ AddLayerAnimationsForMinimize(window, true);
// Now that the window has been restored, we need to clear its animation style
// to default so that normal animation applies.
@@ -153,15 +153,14 @@
// Property sets within this scope will be implicitly animated.
ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
- base::TimeDelta duration = views::corewm::GetWindowHideAnimationDuration(
- window,
- base::TimeDelta::FromMilliseconds(kLayerAnimationsForMinimizeDurationMS));
+ base::TimeDelta duration = base::TimeDelta::FromMilliseconds(
+ kLayerAnimationsForMinimizeDurationMS);
settings.SetTransitionDuration(duration);
settings.AddObserver(
views::corewm::CreateHidingWindowAnimationObserver(window));
window->layer()->SetVisible(false);
- AddLayerAnimationsForMinimize(window, duration, false);
+ AddLayerAnimationsForMinimize(window, false);
}
void AnimateShowHideWindowCommon_BrightnessGrayscale(aura::Window* window,
@@ -184,11 +183,8 @@
window->layer()->SetVisible(true);
}
- base::TimeDelta default_duration =
+ base::TimeDelta duration =
base::TimeDelta::FromMilliseconds(kBrightnessGrayscaleFadeDurationMs);
- base::TimeDelta duration = show ?
- views::corewm::GetWindowShowAnimationDuration(window, default_duration) :
- views::corewm::GetWindowHideAnimationDuration(window, default_duration);
ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
settings.SetTransitionDuration(duration);
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698