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

Unified Diff: ash/wm/window_animations.cc

Issue 180273025: Keep dedicated layers for hiding animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/system_modal_container_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
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index 7bae5a3b26efd561f969750120daba1aece24d26..e69b94bae95e49a33e14de132ae2cec35a976ba2 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -155,7 +155,6 @@ void AddLayerAnimationsForMinimize(aura::Window* window, bool show) {
}
void AnimateShowWindow_Minimize(aura::Window* window) {
- window->layer()->set_delegate(window);
window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
base::TimeDelta duration = base::TimeDelta::FromMilliseconds(
@@ -170,15 +169,11 @@ void AnimateShowWindow_Minimize(aura::Window* window) {
}
void AnimateHideWindow_Minimize(aura::Window* window) {
- window->layer()->set_delegate(NULL);
-
// Property sets within this scope will be implicitly animated.
- ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
+ ::wm::ScopedHidingAnimationSettings hiding_settings(window);
base::TimeDelta duration = base::TimeDelta::FromMilliseconds(
kLayerAnimationsForMinimizeDurationMS);
- settings.SetTransitionDuration(duration);
- settings.AddObserver(
- ::wm::CreateHidingWindowAnimationObserver(window));
+ hiding_settings.layer_animation_settings()->SetTransitionDuration(duration);
window->layer()->SetVisible(false);
AddLayerAnimationsForMinimize(window, false);
@@ -186,8 +181,6 @@ void AnimateHideWindow_Minimize(aura::Window* window) {
void AnimateShowHideWindowCommon_BrightnessGrayscale(aura::Window* window,
bool show) {
- window->layer()->set_delegate(window);
-
float start_value, end_value;
if (show) {
start_value = kWindowAnimation_HideBrightnessGrayscale;
@@ -207,17 +200,16 @@ void AnimateShowHideWindowCommon_BrightnessGrayscale(aura::Window* window,
base::TimeDelta duration =
base::TimeDelta::FromMilliseconds(kBrightnessGrayscaleFadeDurationMs);
- ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
- settings.SetTransitionDuration(duration);
- if (!show) {
- settings.AddObserver(
- ::wm::CreateHidingWindowAnimationObserver(window));
- }
-
- window->layer()->GetAnimator()->
- ScheduleTogether(
- CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
- if (!show) {
+ if (show) {
+ ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
+ window->layer()->GetAnimator()->
+ ScheduleTogether(
+ CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
+ } else {
+ ::wm::ScopedHidingAnimationSettings hiding_settings(window);
+ window->layer()->GetAnimator()->
+ ScheduleTogether(
+ CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
window->layer()->SetVisible(false);
}
« no previous file with comments | « ash/wm/system_modal_container_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