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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 525002: Mac: Cmd-three finger swipe should open prev/next page in new tab. (Closed)
Patch Set: foo Created 10 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <Carbon/Carbon.h> 5 #include <Carbon/Carbon.h>
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "base/mac_util.h" 8 #include "base/mac_util.h"
9 #include "base/scoped_nsdisable_screen_updates.h" 9 #include "base/scoped_nsdisable_screen_updates.h"
10 #import "base/scoped_nsobject.h" 10 #import "base/scoped_nsobject.h"
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 // likely add a public API, but the worst that will happen is that this will 1440 // likely add a public API, but the worst that will happen is that this will
1441 // turn into dead code and just won't get called. 1441 // turn into dead code and just won't get called.
1442 - (void)swipeWithEvent:(NSEvent*)event { 1442 - (void)swipeWithEvent:(NSEvent*)event {
1443 // Map forwards and backwards to history; left is positive, right is negative. 1443 // Map forwards and backwards to history; left is positive, right is negative.
1444 unsigned int command = 0; 1444 unsigned int command = 0;
1445 if ([event deltaX] > 0.5) 1445 if ([event deltaX] > 0.5)
1446 command = IDC_BACK; 1446 command = IDC_BACK;
1447 else if ([event deltaX] < -0.5) 1447 else if ([event deltaX] < -0.5)
1448 command = IDC_FORWARD; 1448 command = IDC_FORWARD;
1449 else if ([event deltaY] > 0.5) 1449 else if ([event deltaY] > 0.5)
1450 ; // TODO(pinkerton): figure out page-up 1450 ; // TODO(pinkerton): figure out page-up, http://crbug.com/16305
1451 else if ([event deltaY] < -0.5) 1451 else if ([event deltaY] < -0.5)
1452 ; // TODO(pinkerton): figure out page-down 1452 ; // TODO(pinkerton): figure out page-down, http://crbug.com/16305
1453 1453
1454 // Ensure the command is valid first (ExecuteCommand() won't do that) and 1454 // Ensure the command is valid first (ExecuteCommand() won't do that) and
1455 // then make it so. 1455 // then make it so.
1456 if (browser_->command_updater()->IsCommandEnabled(command)) 1456 if (browser_->command_updater()->IsCommandEnabled(command))
1457 browser_->ExecuteCommand(command); 1457 browser_->ExecuteCommandWithDisposition(command,
1458 event_utils::WindowOpenDispositionFromNSEvent(event));
1458 } 1459 }
1459 1460
1460 // Delegate method called when window is resized. 1461 // Delegate method called when window is resized.
1461 - (void)windowDidResize:(NSNotification*)notification { 1462 - (void)windowDidResize:(NSNotification*)notification {
1462 // Resize (and possibly move) the status bubble. Note that we may get called 1463 // Resize (and possibly move) the status bubble. Note that we may get called
1463 // when the status bubble does not exist. 1464 // when the status bubble does not exist.
1464 if (statusBubble_) { 1465 if (statusBubble_) {
1465 statusBubble_->UpdateSizeAndPosition(); 1466 statusBubble_->UpdateSizeAndPosition();
1466 } 1467 }
1467 } 1468 }
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 if (frameOverlayInactiveImage) { 1957 if (frameOverlayInactiveImage) {
1957 [theme setValue:frameOverlayInactiveImage 1958 [theme setValue:frameOverlayInactiveImage
1958 forAttribute:@"overlay" 1959 forAttribute:@"overlay"
1959 style:GTMThemeStyleWindow 1960 style:GTMThemeStyleWindow
1960 state:GTMThemeStateInactiveWindow]; 1961 state:GTMThemeStateInactiveWindow];
1961 } 1962 }
1962 1963
1963 return theme; 1964 return theme;
1964 } 1965 }
1965 @end 1966 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698