| 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 "ui/wm/core/window_animations.h" | 5 #include "ui/wm/core/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 20 matching lines...) Expand all Loading... |
| 31 #include "ui/gfx/animation/animation.h" | 31 #include "ui/gfx/animation/animation.h" |
| 32 #include "ui/gfx/geometry/vector3d_f.h" | 32 #include "ui/gfx/geometry/vector3d_f.h" |
| 33 #include "ui/gfx/interpolated_transform.h" | 33 #include "ui/gfx/interpolated_transform.h" |
| 34 #include "ui/gfx/rect_conversions.h" | 34 #include "ui/gfx/rect_conversions.h" |
| 35 #include "ui/gfx/screen.h" | 35 #include "ui/gfx/screen.h" |
| 36 #include "ui/gfx/vector2d.h" | 36 #include "ui/gfx/vector2d.h" |
| 37 #include "ui/wm/core/window_util.h" | 37 #include "ui/wm/core/window_util.h" |
| 38 #include "ui/wm/core/wm_core_switches.h" | 38 #include "ui/wm/core/wm_core_switches.h" |
| 39 #include "ui/wm/public/animation_host.h" | 39 #include "ui/wm/public/animation_host.h" |
| 40 | 40 |
| 41 DECLARE_WINDOW_PROPERTY_TYPE(int) |
| 41 DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationType) | 42 DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationType) |
| 42 DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationTransition) | 43 DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationTransition) |
| 43 DECLARE_WINDOW_PROPERTY_TYPE(float) | 44 DECLARE_WINDOW_PROPERTY_TYPE(float) |
| 45 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(WM_EXPORT, bool) |
| 44 | 46 |
| 45 namespace wm { | 47 namespace wm { |
| 46 namespace { | 48 namespace { |
| 47 const float kWindowAnimation_Vertical_TranslateY = 15.f; | 49 const float kWindowAnimation_Vertical_TranslateY = 15.f; |
| 48 | 50 |
| 49 // A base class for hiding animation observer which has two roles: | 51 // A base class for hiding animation observer which has two roles: |
| 50 // 1) Notifies AnimationHost at the end of hiding animation. | 52 // 1) Notifies AnimationHost at the end of hiding animation. |
| 51 // 2) Detaches the window's layers for hiding animation and deletes | 53 // 2) Detaches the window's layers for hiding animation and deletes |
| 52 // them upon completion of the animation. This is necessary to a) | 54 // them upon completion of the animation. This is necessary to a) |
| 53 // ensure that the animation continues in the event of the window being | 55 // ensure that the animation continues in the event of the window being |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 // being accessed via Remote Desktop. | 661 // being accessed via Remote Desktop. |
| 660 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == | 662 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == |
| 661 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) | 663 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) |
| 662 return false; | 664 return false; |
| 663 | 665 |
| 664 // Let the user decide whether or not to play the animation. | 666 // Let the user decide whether or not to play the animation. |
| 665 return !gfx::Animation::ShouldRenderRichAnimation(); | 667 return !gfx::Animation::ShouldRenderRichAnimation(); |
| 666 } | 668 } |
| 667 | 669 |
| 668 } // namespace wm | 670 } // namespace wm |
| OLD | NEW |