summaryrefslogtreecommitdiffstats
path: root/app/animation.cc
diff options
context:
space:
mode:
authoryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-06 10:04:15 +0000
committeryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-06 10:04:15 +0000
commit6289beb1a1caa052d9379923e2a7a344edb74839 (patch)
treed86ead3d27e21eafe2490a9ddc0526cd5b57bf22 /app/animation.cc
parent8a17bd55d6f0336a3d8e3c66af61a0a3b074dfe9 (diff)
downloadchromium_src-6289beb1a1caa052d9379923e2a7a344edb74839.zip
chromium_src-6289beb1a1caa052d9379923e2a7a344edb74839.tar.gz
chromium_src-6289beb1a1caa052d9379923e2a7a344edb74839.tar.bz2
Second (and hopefully the final) fix for the issue 805:
Killed (1) the "start download" (big arrow) animation and (2) fade and resize animation on NTP page, when the following conditions is met: (XP) Chromium is used over RDP. (Vista) "Turn off all unnecessary animations (when possible)" option in "Control Panel - Ease of Access Center - Make the computer easier to see" is checked. Note that the option automatically becomes checked when a user turns off the "Menu and window animation" option of a remote-desktop client. Review: http://codereview.chromium.org/115304 BUG=805 TEST=For (1), download a file and verify the arrow doesn't appear over RDP. For (2), set NTP as your homepage, start chromium on RDP session, verify fade animations on thumbnails are killed, then resize browser window, verify resize animations on thumbnails are also killed. Do the same thing with --new-new-tab-page command line flag. Review URL: http://codereview.chromium.org/118307 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/animation.cc')
-rw-r--r--app/animation.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/animation.cc b/app/animation.cc
index 6a4e7b7..59d3dea 100644
--- a/app/animation.cc
+++ b/app/animation.cc
@@ -6,6 +6,10 @@
#include "base/message_loop.h"
+#if defined(OS_WIN)
+#include "base/win_util.h"
+#endif
+
using base::TimeDelta;
Animation::Animation(int frame_rate,
@@ -122,3 +126,23 @@ int Animation::CalculateInterval(int frame_rate) {
timer_interval = 10;
return timer_interval;
}
+
+// static
+bool Animation::ShouldRenderRichAnimation() {
+#if defined(OS_WIN)
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) {
+ BOOL result;
+ // Get "Turn off all unnecessary animations" value.
+ if (::SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &result, 0)) {
+ // There seems to be a typo in the MSDN document (as of May 2009):
+ // http://msdn.microsoft.com/en-us/library/ms724947(VS.85).aspx
+ // The document states that the result is TRUE when animations are
+ // _disabled_, but in fact, it is TRUE when they are _enabled_.
+ return !!result;
+ }
+ }
+ return !::GetSystemMetrics(SM_REMOTESESSION);
+#endif
+ return true;
+}
+