Index: ui/gfx/animation/animation_mac.mm |
diff --git a/ui/gfx/animation/animation_mac.mm b/ui/gfx/animation/animation_mac.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b14f5e157a446435f79e0602a3be7eee66efee06 |
--- /dev/null |
+++ b/ui/gfx/animation/animation_mac.mm |
@@ -0,0 +1,33 @@ |
+// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
Avi (use Gerrit)
2016/02/10 00:24:54
no (c)
bokan
2016/02/10 16:31:22
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ui/gfx/animation/animation.h" |
+ |
+#include "base/mac/mac_util.h" |
+#include "base/message_loop/message_loop.h" |
+ |
+namespace gfx { |
+ |
+// static |
+bool Animation::ScrollAnimationsEnabledBySystem() { |
+ // Because of sandboxing, OS settings should only be queried from the browser |
+ // process. |
+ DCHECK(base::MessageLoopForUI::IsCurrent() || |
Robert Sesek
2016/02/09 18:57:45
Not sure about how useful this DCHCEK is. It would
bokan
2016/02/09 19:00:38
AFAICT, renderer processes run on a "custom" messa
|
+ base::MessageLoopForIO::IsCurrent()); |
+ |
+ bool enabled = false; |
+ id value = nil; |
+ if (base::mac::IsOSMountainLionOrLater()) { |
+ value = [[NSUserDefaults standardUserDefaults] |
+ objectForKey:@"NSScrollAnimationEnabled"]; |
+ } else { |
+ value = [[NSUserDefaults standardUserDefaults] |
+ objectForKey:@"AppleScrollAnimationEnabled"]; |
+ } |
+ if (value) |
+ enabled = [value boolValue]; |
+ return enabled; |
+} |
+ |
+} // namespace gfx |