OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_util.h" | 5 #include "base/mac_util.h" |
6 #import "chrome/browser/cocoa/tab_controller.h" | 6 #import "chrome/browser/cocoa/tab_controller.h" |
7 #import "chrome/browser/cocoa/tab_controller_target.h" | 7 #import "chrome/browser/cocoa/tab_controller_target.h" |
8 | 8 |
9 @implementation TabController | 9 @implementation TabController |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 [self internalSetSelected:selected_]; | 49 [self internalSetSelected:selected_]; |
50 } | 50 } |
51 | 51 |
52 - (IBAction)closeTab:(id)sender { | 52 - (IBAction)closeTab:(id)sender { |
53 if ([[self target] respondsToSelector:@selector(closeTab:)]) { | 53 if ([[self target] respondsToSelector:@selector(closeTab:)]) { |
54 [[self target] performSelector:@selector(closeTab:) | 54 [[self target] performSelector:@selector(closeTab:) |
55 withObject:[self view]]; | 55 withObject:[self view]]; |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
| 59 - (void)setTitle:(NSString *)title { |
| 60 [backgroundButton_ setToolTip:title]; |
| 61 [super setTitle:title]; |
| 62 } |
| 63 |
59 - (void)setSelected:(BOOL)selected { | 64 - (void)setSelected:(BOOL)selected { |
60 if (selected_ != selected) | 65 if (selected_ != selected) |
61 [self internalSetSelected:selected]; | 66 [self internalSetSelected:selected]; |
62 } | 67 } |
63 | 68 |
64 - (BOOL)selected { | 69 - (BOOL)selected { |
65 return selected_; | 70 return selected_; |
66 } | 71 } |
67 | 72 |
68 - (void)setIconView:(NSView*)iconView { | 73 - (void)setIconView:(NSView*)iconView { |
69 NSRect currentFrame = [iconView_ frame]; | 74 NSRect currentFrame = [iconView_ frame]; |
70 [iconView_ removeFromSuperview]; | 75 [iconView_ removeFromSuperview]; |
71 iconView_ = iconView; | 76 iconView_ = iconView; |
72 [iconView_ setFrame:currentFrame]; | 77 [iconView_ setFrame:currentFrame]; |
73 [[self view] addSubview:iconView_]; | 78 [[self view] addSubview:iconView_]; |
74 } | 79 } |
75 | 80 |
76 - (NSView*)iconView { | 81 - (NSView*)iconView { |
77 return iconView_; | 82 return iconView_; |
78 } | 83 } |
79 | 84 |
| 85 - (NSString *)toolTip { |
| 86 return [backgroundButton_ toolTip]; |
| 87 } |
| 88 |
80 @end | 89 @end |
OLD | NEW |