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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 7565007: Clicking tab close with option key close the other tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed rsesek's comments. Created 9 years, 4 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
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 43f2a21033d3c7802165ed6ba73e89d8615682aa..76ba4abe41823f3d398d5f8be6cbba442fa438ec 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -743,6 +743,15 @@ 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 {

Powered by Google App Engine
This is Rietveld 408576698