summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 16:36:30 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 16:36:30 +0000
commit8c18cbcb08fba3073f2a362f45c66ebdd72e9cc1 (patch)
treef2990a5d21236cd3bce90ce9453c447191c6ffca /chrome
parentee86cb81cde66cbf53704d643440c3b71376de13 (diff)
downloadchromium_src-8c18cbcb08fba3073f2a362f45c66ebdd72e9cc1.zip
chromium_src-8c18cbcb08fba3073f2a362f45c66ebdd72e9cc1.tar.gz
chromium_src-8c18cbcb08fba3073f2a362f45c66ebdd72e9cc1.tar.bz2
Support middle-click-to-close on the Mac.
BUG=11146 TEST=Middle-clicking a tab should close it (any other mouse buttons should not). Review URL: http://codereview.chromium.org/115683 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16746 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/tab_view.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_view.mm b/chrome/browser/cocoa/tab_view.mm
index 8566eac..1033546 100644
--- a/chrome/browser/cocoa/tab_view.mm
+++ b/chrome/browser/cocoa/tab_view.mm
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/cocoa/tab_controller.h"
#include "chrome/browser/cocoa/tab_view.h"
#include "chrome/browser/cocoa/tab_window_controller.h"
@@ -304,4 +305,11 @@
[sourceController removePlaceholder];
}
+- (void)otherMouseUp:(NSEvent*) theEvent {
+ // Support middle-click-to-close.
+ if ([theEvent buttonNumber] == 2) {
+ [controller_ closeTab:self];
+ }
+}
+
@end