OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/mac/mac_util.h" | |
8 #import "base/memory/scoped_nsobject.h" | 9 #import "base/memory/scoped_nsobject.h" |
9 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
11 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 12 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 14 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
14 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
15 #import "chrome/browser/ui/cocoa/fast_resize_view.h" | 16 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
16 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" | 17 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" |
17 #import "chrome/browser/ui/cocoa/floating_bar_backing_view.h" | 18 #import "chrome/browser/ui/cocoa/floating_bar_backing_view.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
536 return; | 537 return; |
537 | 538 |
538 barVisibilityUpdatesEnabled_ = NO; | 539 barVisibilityUpdatesEnabled_ = NO; |
539 [fullscreenController_ cancelAnimationAndTimers]; | 540 [fullscreenController_ cancelAnimationAndTimers]; |
540 } | 541 } |
541 | 542 |
542 - (void)setUpOSFullScreenButton { | 543 - (void)setUpOSFullScreenButton { |
543 // TOOD(rsesek): Properly implement Lion fullscreen <http://crbug.com/74065>. | 544 // TOOD(rsesek): Properly implement Lion fullscreen <http://crbug.com/74065>. |
544 } | 545 } |
545 | 546 |
547 - (BOOL)recognizeTwoFingerGestures { | |
548 // Lion or higher will have support for two-finger swipe gestures. | |
549 if (!base::mac::IsOSLionOrLater()) | |
550 return NO; | |
551 | |
552 // A note about preferences: | |
553 // On Lion System Preferences, the swipe gesture behavior is controlled by the | |
554 // setting in Trackpad --> More Gestures --> Swipe between pages. This setting | |
555 // has three values: | |
556 // A) Scroll left or right with two fingers. This should perform a cool | |
557 // scrolling animation, but doesn't yet <http://crbug.com/90228>. | |
558 // B) Swipe left or right with three fingers. | |
559 // C) Swipe with two or three fingers. | |
Nico
2011/07/22 20:21:14
In this case, the -swipe method isn't called becau
Robert Sesek
2011/07/22 20:26:23
Only for three fingers. That's always done by the
Nico
2011/07/22 20:30:08
I understood this. I was wondering if we would get
| |
560 // | |
561 // The three-finger gesture is controlled by the integer preference | |
562 // |com.apple.trackpad.threeFingerHorizSwipeGesture|. Its value is 0 for (A) | |
563 // and 1 for (B, C). | |
564 // | |
565 // The two-finger gesture is controlled by the preference below and is boolean | |
566 // YES for (A, C) and NO for (B). | |
567 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | |
568 return [defaults boolForKey:@"AppleEnableSwipeNavigateWithScrolls"]; | |
569 } | |
570 | |
546 @end // @implementation BrowserWindowController(Private) | 571 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |