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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_controller_target.h » ('j') | 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 #include "base/mac/mac_util.h" 5 #include "base/mac/mac_util.h"
6 #import "chrome/browser/themes/theme_service.h" 6 #import "chrome/browser/themes/theme_service.h"
7 #import "chrome/browser/ui/cocoa/menu_controller.h" 7 #import "chrome/browser/ui/cocoa/menu_controller.h"
8 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" 8 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
9 #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h" 9 #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h"
10 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" 10 #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 contextMenuModel_.reset( 137 contextMenuModel_.reset(
138 [target_ contextMenuModelForController:self 138 [target_ contextMenuModelForController:self
139 menuDelegate:contextMenuDelegate_.get()]); 139 menuDelegate:contextMenuDelegate_.get()]);
140 contextMenuController_.reset( 140 contextMenuController_.reset(
141 [[MenuController alloc] initWithModel:contextMenuModel_.get() 141 [[MenuController alloc] initWithModel:contextMenuModel_.get()
142 useWithPopUpButtonCell:NO]); 142 useWithPopUpButtonCell:NO]);
143 return [contextMenuController_ menu]; 143 return [contextMenuController_ menu];
144 } 144 }
145 145
146 - (IBAction)closeTab:(id)sender { 146 - (IBAction)closeTab:(id)sender {
147 if (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) &&
148 [[self target] respondsToSelector:@selector(closeOtherTabs:)]) {
149 [[self target] performSelector:@selector(closeOtherTabs:)
150 withObject:[self view]];
151 return;
152 }
147 if ([[self target] respondsToSelector:@selector(closeTab:)]) { 153 if ([[self target] respondsToSelector:@selector(closeTab:)]) {
148 [[self target] performSelector:@selector(closeTab:) 154 [[self target] performSelector:@selector(closeTab:)
149 withObject:[self view]]; 155 withObject:[self view]];
150 } 156 }
151 } 157 }
152 158
153 - (void)setTitle:(NSString*)title { 159 - (void)setTitle:(NSString*)title {
154 [[self view] setToolTip:title]; 160 [[self view] setToolTip:title];
155 if ([self mini] && ![self selected]) { 161 if ([self mini] && ![self selected]) {
156 TabView* tabView = static_cast<TabView*>([self view]); 162 TabView* tabView = static_cast<TabView*>([self view]);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 337
332 - (void)continueDrag:(NSEvent*)event { 338 - (void)continueDrag:(NSEvent*)event {
333 [[target_ dragController] continueDrag:event]; 339 [[target_ dragController] continueDrag:event];
334 } 340 }
335 341
336 - (void)endDrag:(NSEvent*)event { 342 - (void)endDrag:(NSEvent*)event {
337 [[target_ dragController] endDrag:event]; 343 [[target_ dragController] endDrag:event];
338 } 344 }
339 345
340 @end 346 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_controller_target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698