OLD | NEW |
---|---|
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 Loading... | |
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) { | |
Robert Sesek
2011/08/09 15:20:37
nit: extra spaces
bashi
2011/08/10 06:52:30
Done.
| |
148 if ([[self target] respondsToSelector:@selector(closeOtherTabs:)]) { | |
Robert Sesek
2011/08/09 15:20:37
Combine these two if's with &&
bashi
2011/08/10 06:52:30
Done.
| |
149 [[self target] performSelector:@selector(closeOtherTabs:) | |
150 withObject:[self view]]; | |
151 return; | |
152 } | |
153 } | |
147 if ([[self target] respondsToSelector:@selector(closeTab:)]) { | 154 if ([[self target] respondsToSelector:@selector(closeTab:)]) { |
148 [[self target] performSelector:@selector(closeTab:) | 155 [[self target] performSelector:@selector(closeTab:) |
149 withObject:[self view]]; | 156 withObject:[self view]]; |
150 } | 157 } |
151 } | 158 } |
152 | 159 |
153 - (void)setTitle:(NSString*)title { | 160 - (void)setTitle:(NSString*)title { |
154 [[self view] setToolTip:title]; | 161 [[self view] setToolTip:title]; |
155 if ([self mini] && ![self selected]) { | 162 if ([self mini] && ![self selected]) { |
156 TabView* tabView = static_cast<TabView*>([self view]); | 163 TabView* tabView = static_cast<TabView*>([self view]); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
331 | 338 |
332 - (void)continueDrag:(NSEvent*)event { | 339 - (void)continueDrag:(NSEvent*)event { |
333 [[target_ dragController] continueDrag:event]; | 340 [[target_ dragController] continueDrag:event]; |
334 } | 341 } |
335 | 342 |
336 - (void)endDrag:(NSEvent*)event { | 343 - (void)endDrag:(NSEvent*)event { |
337 [[target_ dragController] endDrag:event]; | 344 [[target_ dragController] endDrag:event]; |
338 } | 345 } |
339 | 346 |
340 @end | 347 @end |
OLD | NEW |