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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 7709023: Revert 97828 - Clicking tab close with option key close the other tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_controller_unittest.mm ('k') | 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) 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/tabs/tab_strip_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 TabStripModel::CLOSE_USER_GESTURE | 721 TabStripModel::CLOSE_USER_GESTURE |
722 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); 722 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB);
723 } else { 723 } else {
724 // Use the standard window close if this is the last tab 724 // Use the standard window close if this is the last tab
725 // this prevents the tab from being removed from the model until after 725 // this prevents the tab from being removed from the model until after
726 // the window dissapears 726 // the window dissapears
727 [[tabStripView_ window] performClose:nil]; 727 [[tabStripView_ window] performClose:nil];
728 } 728 }
729 } 729 }
730 730
731 // Called when the user closes all tabs except for the current tab.
732 // Invoke the |CommandCloseOtherTabs| context menu command.
733 - (void)closeOtherTabs:(id)sender {
734 int index = [self modelIndexForTabView:sender];
735 if (tabStripModel_->ContainsIndex(index)) {
736 tabStripModel_->ExecuteContextMenuCommand(
737 index, TabStripModel::CommandCloseOtherTabs);
738 }
739 }
740
741 // Dispatch context menu commands for the given tab controller. 731 // Dispatch context menu commands for the given tab controller.
742 - (void)commandDispatch:(TabStripModel::ContextMenuCommand)command 732 - (void)commandDispatch:(TabStripModel::ContextMenuCommand)command
743 forController:(TabController*)controller { 733 forController:(TabController*)controller {
744 int index = [self modelIndexForTabView:[controller view]]; 734 int index = [self modelIndexForTabView:[controller view]];
745 if (tabStripModel_->ContainsIndex(index)) 735 if (tabStripModel_->ContainsIndex(index))
746 tabStripModel_->ExecuteContextMenuCommand(index, command); 736 tabStripModel_->ExecuteContextMenuCommand(index, command);
747 } 737 }
748 738
749 // Returns YES if the specificed command should be enabled for the given 739 // Returns YES if the specificed command should be enabled for the given
750 // controller. 740 // controller.
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 NSInteger index = [self indexFromModelIndex:modelIndex]; 2013 NSInteger index = [self indexFromModelIndex:modelIndex];
2024 BrowserWindowController* controller = 2014 BrowserWindowController* controller =
2025 (BrowserWindowController*)[[switchView_ window] windowController]; 2015 (BrowserWindowController*)[[switchView_ window] windowController];
2026 DCHECK(index >= 0); 2016 DCHECK(index >= 0);
2027 if (index >= 0) { 2017 if (index >= 0) {
2028 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; 2018 [controller setTab:[self viewAtIndex:index] isDraggable:YES];
2029 } 2019 }
2030 } 2020 }
2031 2021
2032 @end 2022 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698