Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: ui/gfx/animation/animation_mac.mm

Issue 1653003002: Make scrollAnimatorEnabled work on Mac like it does on other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Previous patch accidentally lost new files Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/animation/animation.cc ('k') | ui/gfx/animation/animation_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e3a4ff2ab0f74da5f715d4e8ae4a3d6a86cbfb38
--- /dev/null
+++ b/ui/gfx/animation/animation_mac.mm
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// 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() ||
+ 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
« no previous file with comments | « ui/gfx/animation/animation.cc ('k') | ui/gfx/animation/animation_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698