Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
index d63f04f61d8d3b144051f038dc6d0bd4e0b8a7b8..d4b22d4cf521bdda7b853fdd604a168ca9be90c3 100644 |
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
@@ -743,6 +743,16 @@ private: |
} |
} |
+// Called when the user closes all tabs except for the current tab. |
+// Invoke the |CommandCloseOtherTabs| context menu command. |
+- (void)closeOtherTabs:(id)sender { |
+ int index = [self modelIndexForTabView:sender]; |
+ if (tabStripModel_->ContainsIndex(index)) { |
+ tabStripModel_->ExecuteContextMenuCommand( |
+ index, TabStripModel::CommandCloseOtherTabs); |
+ } |
+} |
+ |
// Dispatch context menu commands for the given tab controller. |
- (void)commandDispatch:(TabStripModel::ContextMenuCommand)command |
forController:(TabController*)controller { |