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

Unified Diff: chrome/browser/ui/cocoa/gesture_utils.mm

Issue 7618036: mac: Only let two-finger-scrolling trigger history if web doesn't swallow gesture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TestRenderViewHost Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/gesture_utils.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/gesture_utils.mm
diff --git a/chrome/browser/ui/cocoa/gesture_utils.mm b/chrome/browser/ui/cocoa/gesture_utils.mm
deleted file mode 100644
index b2e2943d66c45115356ec4adb39fd2077c78a667..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/cocoa/gesture_utils.mm
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "chrome/browser/ui/cocoa/gesture_utils.h"
-
-#include "base/mac/mac_util.h"
-
-namespace gesture_utils {
-
-BOOL RecognizeTwoFingerGestures() {
- // Lion or higher will have support for two-finger swipe gestures.
- if (!base::mac::IsOSLionOrLater())
- return NO;
-
- // A note about preferences:
- // On Lion System Preferences, the swipe gesture behavior is controlled by the
- // setting in Trackpad --> More Gestures --> Swipe between pages. This setting
- // has three values:
- // A) Scroll left or right with two fingers. This should perform a cool
- // scrolling animation, but doesn't yet <http://crbug.com/90228>.
- // B) Swipe left or right with three fingers.
- // C) Swipe with two or three fingers.
- //
- // The three-finger gesture is controlled by the integer preference
- // |com.apple.trackpad.threeFingerHorizSwipeGesture|. Its value is 0 for (A)
- // and 1 for (B, C).
- //
- // The two-finger gesture is controlled by the preference below and is boolean
- // YES for (A, C) and NO for (B).
- NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- [defaults synchronize];
-
- // By default, the preference is not set. When it's not, the intrinsic Lion
- // default (YES) should be returned.
- NSDictionary* prefs = [defaults dictionaryRepresentation];
- NSNumber* value = [prefs objectForKey:@"AppleEnableSwipeNavigateWithScrolls"];
- if (!value)
- return YES;
-
- // If the preference is set, return the value.
- return [value boolValue];
-}
-
-// On Lion, returns YES if the scroll direction is "natural"/inverted. All other
-// OSes will return NO.
-BOOL IsScrollDirectionInverted() {
- if (!base::mac::IsOSLionOrLater())
- return NO;
-
- NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- [defaults synchronize];
-
- // By default, the preference is not set. When it's not, the intrinsic Lion
- // default (YES) should be returned.
- NSDictionary* prefs = [defaults dictionaryRepresentation];
- NSNumber* value = [prefs objectForKey:@"com.apple.swipescrolldirection"];
- if (!value)
- return YES;
-
- return [value boolValue];
-}
-
-} // namespace gesture_utils
« no previous file with comments | « chrome/browser/ui/cocoa/gesture_utils.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698