Chromium Code Reviews| Index: base/mac/mac_util.mm |
| diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm |
| index 75d53c90961086c6225b352981d181a8d5733524..02ae6265b64a7a374ecaf7c069eb633c83f701bc 100644 |
| --- a/base/mac/mac_util.mm |
| +++ b/base/mac/mac_util.mm |
| @@ -21,6 +21,7 @@ |
| #include "base/mac/scoped_ioobject.h" |
| #include "base/mac/scoped_nsobject.h" |
| #include "base/mac/sdk_forward_declarations.h" |
| +#include "base/message_loop/message_loop.h" |
| #include "base/strings/string_number_conversions.h" |
| #include "base/strings/string_piece.h" |
| #include "base/strings/sys_string_conversions.h" |
| @@ -603,5 +604,26 @@ bool ParseModelIdentifier(const std::string& ident, |
| return true; |
| } |
| +bool IsScrollAnimationEnabled() { |
|
Robert Sesek
2016/02/08 17:39:51
I don't think this needs to be in base, since it's
bokan
2016/02/08 20:55:06
Done. I moved the Windows bits into animation_win.
|
| + // 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 mac |
| } // namespace base |