Chromium Code Reviews| 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/views/corewm/window_animations.h" | 5 #include "ui/views/corewm/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> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "ui/aura/client/animation_host.h" | 18 #include "ui/aura/client/animation_host.h" |
| 19 #include "ui/aura/client/aura_constants.h" | 19 #include "ui/aura/client/aura_constants.h" |
| 20 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| 21 #include "ui/aura/window_delegate.h" | 21 #include "ui/aura/window_delegate.h" |
| 22 #include "ui/aura/window_observer.h" | 22 #include "ui/aura/window_observer.h" |
| 23 #include "ui/aura/window_property.h" | 23 #include "ui/aura/window_property.h" |
| 24 #include "ui/compositor/compositor_observer.h" | 24 #include "ui/compositor/compositor_observer.h" |
| 25 #include "ui/compositor/layer.h" | 25 #include "ui/compositor/layer.h" |
| 26 #include "ui/compositor/layer_animation_observer.h" | 26 #include "ui/compositor/layer_animation_observer.h" |
| 27 #include "ui/compositor/layer_animation_sequence.h" | 27 #include "ui/compositor/layer_animation_sequence.h" |
| 28 #include "ui/compositor/layer_animator.h" | 28 #include "ui/compositor/layer_animator.h" |
| 29 #include "ui/compositor/scoped_layer_animation_settings.h" | 29 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 30 #include "ui/gfx/animation/animation.h" | |
| 30 #include "ui/gfx/interpolated_transform.h" | 31 #include "ui/gfx/interpolated_transform.h" |
| 31 #include "ui/gfx/rect_conversions.h" | 32 #include "ui/gfx/rect_conversions.h" |
| 32 #include "ui/gfx/screen.h" | 33 #include "ui/gfx/screen.h" |
| 33 #include "ui/gfx/vector2d.h" | 34 #include "ui/gfx/vector2d.h" |
| 34 #include "ui/gfx/vector3d_f.h" | 35 #include "ui/gfx/vector3d_f.h" |
| 35 #include "ui/views/corewm/corewm_switches.h" | 36 #include "ui/views/corewm/corewm_switches.h" |
| 36 #include "ui/views/corewm/window_util.h" | 37 #include "ui/views/corewm/window_util.h" |
| 37 #include "ui/views/view.h" | 38 #include "ui/views/view.h" |
| 38 #include "ui/views/widget/widget.h" | 39 #include "ui/views/widget/widget.h" |
| 39 | 40 |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 560 case WINDOW_ANIMATION_TYPE_BOUNCE: | 561 case WINDOW_ANIMATION_TYPE_BOUNCE: |
| 561 AnimateBounce(window); | 562 AnimateBounce(window); |
| 562 return true; | 563 return true; |
| 563 default: | 564 default: |
| 564 NOTREACHED(); | 565 NOTREACHED(); |
| 565 return false; | 566 return false; |
| 566 } | 567 } |
| 567 } | 568 } |
| 568 | 569 |
| 569 bool WindowAnimationsDisabled(aura::Window* window) { | 570 bool WindowAnimationsDisabled(aura::Window* window) { |
| 571 if (!gfx::Animation::ShouldRenderRichAnimation()) | |
|
sky
2014/02/03 04:40:46
nit: combine into single return statement.
ananta
2014/02/03 19:51:07
Done.
| |
| 572 return true; | |
| 570 return (window && | 573 return (window && |
| 571 window->GetProperty(aura::client::kAnimationsDisabledKey)) || | 574 window->GetProperty(aura::client::kAnimationsDisabledKey)) || |
| 572 CommandLine::ForCurrentProcess()->HasSwitch( | 575 CommandLine::ForCurrentProcess()->HasSwitch( |
| 573 switches::kWindowAnimationsDisabled); | 576 switches::kWindowAnimationsDisabled); |
| 574 } | 577 } |
| 575 | 578 |
| 576 } // namespace corewm | 579 } // namespace corewm |
| 577 } // namespace views | 580 } // namespace views |
| OLD | NEW |