OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/mac/mac_util.h" | 5 #include "base/mac/mac_util.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #import <IOKit/IOKitLib.h> | 8 #import <IOKit/IOKitLib.h> |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 StringPiece(begin + number_loc, begin + comma_loc), &major_tmp) || | 596 StringPiece(begin + number_loc, begin + comma_loc), &major_tmp) || |
597 !StringToInt( | 597 !StringToInt( |
598 StringPiece(begin + comma_loc + 1, ident.end()), &minor_tmp)) | 598 StringPiece(begin + comma_loc + 1, ident.end()), &minor_tmp)) |
599 return false; | 599 return false; |
600 *type = ident.substr(0, number_loc); | 600 *type = ident.substr(0, number_loc); |
601 *major = major_tmp; | 601 *major = major_tmp; |
602 *minor = minor_tmp; | 602 *minor = minor_tmp; |
603 return true; | 603 return true; |
604 } | 604 } |
605 | 605 |
| 606 bool IsScrollAnimationEnabled() { |
| 607 bool enabled = false; |
| 608 id value = nil; |
| 609 if (base::mac::IsOSMountainLionOrLater()) { |
| 610 value = [[NSUserDefaults standardUserDefaults] |
| 611 objectForKey:@"NSScrollAnimationEnabled"]; |
| 612 } else { |
| 613 value = [[NSUserDefaults standardUserDefaults] |
| 614 objectForKey:@"AppleScrollAnimationEnabled"]; |
| 615 } |
| 616 if (value) |
| 617 enabled = [value boolValue]; |
| 618 return enabled; |
| 619 } |
| 620 |
| 621 |
606 } // namespace mac | 622 } // namespace mac |
607 } // namespace base | 623 } // namespace base |
OLD | NEW |