| 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/window_animations.h" | 5 #include "ash/wm/window_animations.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 } | 505 } |
| 506 | 506 |
| 507 window->layer()->SetLayerBrightness(start_value); | 507 window->layer()->SetLayerBrightness(start_value); |
| 508 window->layer()->SetLayerGrayscale(start_value); | 508 window->layer()->SetLayerGrayscale(start_value); |
| 509 if (show) { | 509 if (show) { |
| 510 window->layer()->SetOpacity(kWindowAnimation_ShowOpacity); | 510 window->layer()->SetOpacity(kWindowAnimation_ShowOpacity); |
| 511 window->layer()->SetVisible(true); | 511 window->layer()->SetVisible(true); |
| 512 } | 512 } |
| 513 | 513 |
| 514 int animation_duration = kBrightnessGrayscaleFadeDurationMs; | 514 int animation_duration = kBrightnessGrayscaleFadeDurationMs; |
| 515 ui::Tween::Type animation_type = ui::Tween::EASE_OUT_2; | 515 ui::Tween::Type animation_type = ui::Tween::EASE_OUT; |
| 516 if (CommandLine::ForCurrentProcess()->HasSwitch( | 516 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 517 ash::switches::kAshDisableBootAnimation2)) { | 517 ash::switches::kAshBootAnimationFunction2)) { |
| 518 animation_type = ui::Tween::EASE_OUT; | 518 animation_type = ui::Tween::EASE_OUT_2; |
| 519 } else if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 520 ash::switches::kAshBootAnimationFunction3)) { |
| 521 animation_type = ui::Tween::EASE_OUT_3; |
| 519 } | 522 } |
| 520 | 523 |
| 521 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); | 524 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); |
| 522 settings.SetTransitionDuration( | 525 settings.SetTransitionDuration( |
| 523 base::TimeDelta::FromMilliseconds(animation_duration)); | 526 base::TimeDelta::FromMilliseconds(animation_duration)); |
| 524 if (!show) | 527 if (!show) |
| 525 settings.AddObserver(new HidingWindowAnimationObserver(window)); | 528 settings.AddObserver(new HidingWindowAnimationObserver(window)); |
| 526 | 529 |
| 527 scoped_ptr<ui::LayerAnimationSequence> brightness_sequence( | 530 scoped_ptr<ui::LayerAnimationSequence> brightness_sequence( |
| 528 new ui::LayerAnimationSequence()); | 531 new ui::LayerAnimationSequence()); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 return AnimateShowWindow(window); | 1164 return AnimateShowWindow(window); |
| 1162 } else { | 1165 } else { |
| 1163 // Don't start hiding the window again if it's already being hidden. | 1166 // Don't start hiding the window again if it's already being hidden. |
| 1164 return window->layer()->GetTargetOpacity() != 0.0f && | 1167 return window->layer()->GetTargetOpacity() != 0.0f && |
| 1165 AnimateHideWindow(window); | 1168 AnimateHideWindow(window); |
| 1166 } | 1169 } |
| 1167 } | 1170 } |
| 1168 | 1171 |
| 1169 } // namespace internal | 1172 } // namespace internal |
| 1170 } // namespace ash | 1173 } // namespace ash |
| OLD | NEW |