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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 return false; | 648 return false; |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 bool WindowAnimationsDisabled(aura::Window* window) { | 652 bool WindowAnimationsDisabled(aura::Window* window) { |
653 // Individual windows can choose to skip animations. | 653 // Individual windows can choose to skip animations. |
654 if (window && window->GetProperty(aura::client::kAnimationsDisabledKey)) | 654 if (window && window->GetProperty(aura::client::kAnimationsDisabledKey)) |
655 return true; | 655 return true; |
656 | 656 |
657 // Animations can be disabled globally for testing. | 657 // Animations can be disabled globally for testing. |
658 if (CommandLine::ForCurrentProcess()->HasSwitch( | 658 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
659 switches::kWindowAnimationsDisabled)) | 659 switches::kWindowAnimationsDisabled)) |
660 return true; | 660 return true; |
661 | 661 |
662 // Tests of animations themselves should still run even if the machine is | 662 // Tests of animations themselves should still run even if the machine is |
663 // being accessed via Remote Desktop. | 663 // being accessed via Remote Desktop. |
664 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == | 664 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == |
665 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) | 665 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) |
666 return false; | 666 return false; |
667 | 667 |
668 // Let the user decide whether or not to play the animation. | 668 // Let the user decide whether or not to play the animation. |
669 return !gfx::Animation::ShouldRenderRichAnimation(); | 669 return !gfx::Animation::ShouldRenderRichAnimation(); |
670 } | 670 } |
671 | 671 |
672 } // namespace wm | 672 } // namespace wm |
OLD | NEW |