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