OLD | NEW |
---|---|
(Empty) | |
1 // 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.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/gfx/animation/animation.h" | |
6 | |
7 #include "base/mac/mac_util.h" | |
8 #include "base/message_loop/message_loop.h" | |
9 | |
10 namespace gfx { | |
11 | |
12 // static | |
13 bool Animation::ScrollAnimationsEnabledBySystem() { | |
14 // Because of sandboxing, OS settings should only be queried from the browser | |
15 // process. | |
16 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
| |
17 base::MessageLoopForIO::IsCurrent()); | |
18 | |
19 bool enabled = false; | |
20 id value = nil; | |
21 if (base::mac::IsOSMountainLionOrLater()) { | |
22 value = [[NSUserDefaults standardUserDefaults] | |
23 objectForKey:@"NSScrollAnimationEnabled"]; | |
24 } else { | |
25 value = [[NSUserDefaults standardUserDefaults] | |
26 objectForKey:@"AppleScrollAnimationEnabled"]; | |
27 } | |
28 if (value) | |
29 enabled = [value boolValue]; | |
30 return enabled; | |
31 } | |
32 | |
33 } // namespace gfx | |
OLD | NEW |