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

Side by Side Diff: base/mac/mac_util.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: 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698