OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
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 "base/mac/scoped_smooth_scrolling_disabler_mac.h" | |
6 | |
7 #include <Cocoa/Cocoa.h> | |
8 | |
9 namespace base { | |
10 | |
11 ScopedSmoothScrollingDisabler::ScopedSmoothScrollingDisabler( | |
12 bool actually_disable) { | |
13 if (actually_disable) { | |
14 // With smooth scrolling, cmd-down et al send many small scroll events on a | |
15 // timer, which is problematic for some tests. | |
16 [[NSUserDefaults standardUserDefaults] | |
17 setBool:NO forKey:@"AppleScrollAnimationEnabled"]; | |
Mark Mentovai
2011/08/31 02:59:57
These suck because they leave bad prefs on the dis
Nico
2011/08/31 03:30:51
I couldn't think of one; this is how Apple's DRT d
Mark Mentovai
2011/08/31 03:39:01
My concern is actually the confluence of (a) and (
| |
18 } | |
19 } | |
20 | |
21 ScopedSmoothScrollingDisabler::~ScopedSmoothScrollingDisabler() { | |
22 [[NSUserDefaults standardUserDefaults] | |
23 removeObjectForKey:@"AppleScrollAnimationEnabled"]; | |
24 } | |
25 | |
26 } // namespace base | |
OLD | NEW |