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

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

Issue 7488023: [Mac] Add two-finger gesture support for Lion, which respects the system preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SDK forward-declare Created 9 years, 5 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/browser_window_controller_private.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 85b230f11466d1e2feedb36589786f8401fe0bf8..577decf195e9043c96a7e83b2a9b81c09a2f3bb6 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -5,6 +5,7 @@
#import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
#include "base/command_line.h"
+#include "base/mac/mac_util.h"
#import "base/memory/scoped_nsobject.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -543,4 +544,28 @@ willPositionSheet:(NSWindow*)sheet
// TOOD(rsesek): Properly implement Lion fullscreen <http://crbug.com/74065>.
}
+- (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];
+ return [defaults boolForKey:@"AppleEnableSwipeNavigateWithScrolls"];
+}
+
@end // @implementation BrowserWindowController(Private)
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698