| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/animation/animation.h" | 5 #include "ui/gfx/animation/animation.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/gfx/animation/animation_container.h" | 8 #include "ui/gfx/animation/animation_container.h" |
| 9 #include "ui/gfx/animation/animation_delegate.h" | 9 #include "ui/gfx/animation/animation_delegate.h" |
| 10 #include "ui/gfx/animation/tween.h" | 10 #include "ui/gfx/animation/tween.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 #if defined(OS_MACOSX) |
| 18 #include "base/mac/mac_util.h" |
| 19 #endif |
| 20 |
| 17 namespace gfx { | 21 namespace gfx { |
| 18 | 22 |
| 19 Animation::Animation(base::TimeDelta timer_interval) | 23 Animation::Animation(base::TimeDelta timer_interval) |
| 20 : timer_interval_(timer_interval), | 24 : timer_interval_(timer_interval), |
| 21 is_animating_(false), | 25 is_animating_(false), |
| 22 delegate_(NULL) { | 26 delegate_(NULL) { |
| 23 } | 27 } |
| 24 | 28 |
| 25 Animation::~Animation() { | 29 Animation::~Animation() { |
| 26 // Don't send out notification from the destructor. Chances are the delegate | 30 // Don't send out notification from the destructor. Chances are the delegate |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (::SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &result, 0)) { | 105 if (::SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &result, 0)) { |
| 102 return !!result; | 106 return !!result; |
| 103 } | 107 } |
| 104 } | 108 } |
| 105 return !::GetSystemMetrics(SM_REMOTESESSION); | 109 return !::GetSystemMetrics(SM_REMOTESESSION); |
| 106 #else | 110 #else |
| 107 return true; | 111 return true; |
| 108 #endif | 112 #endif |
| 109 } | 113 } |
| 110 | 114 |
| 115 // static |
| 116 bool Animation::ScrollAnimationsEnabledBySystem() { |
| 117 #if defined(OS_WIN) |
| 118 return ShouldRenderRichAnimation(); |
| 119 #elif defined(OS_MACOSX) |
| 120 return base::mac::IsScrollAnimationEnabled(); |
| 121 #else |
| 122 return true; |
| 123 #endif |
| 124 } |
| 125 |
| 111 bool Animation::ShouldSendCanceledFromStop() { | 126 bool Animation::ShouldSendCanceledFromStop() { |
| 112 return false; | 127 return false; |
| 113 } | 128 } |
| 114 | 129 |
| 115 void Animation::SetStartTime(base::TimeTicks start_time) { | 130 void Animation::SetStartTime(base::TimeTicks start_time) { |
| 116 start_time_ = start_time; | 131 start_time_ = start_time; |
| 117 } | 132 } |
| 118 | 133 |
| 119 base::TimeDelta Animation::GetTimerInterval() const { | 134 base::TimeDelta Animation::GetTimerInterval() const { |
| 120 return timer_interval_; | 135 return timer_interval_; |
| 121 } | 136 } |
| 122 | 137 |
| 123 } // namespace gfx | 138 } // namespace gfx |
| OLD | NEW |