| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/cocoa/tab_controller.h" |
| 6 |
| 7 @implementation TabController |
| 8 |
| 9 @synthesize image = image_; |
| 10 @synthesize loading = loading_; |
| 11 @synthesize target = target_; |
| 12 @synthesize action = action_; |
| 13 |
| 14 + (float)minTabWidth { return 64.0; } |
| 15 + (float)maxTabWidth { return 160.0; } |
| 16 |
| 17 - (TabView*)tabView { |
| 18 return static_cast<TabView*>([self view]); |
| 19 } |
| 20 |
| 21 - (id)init { |
| 22 self = [super initWithNibName:@"TabView" bundle:nil]; |
| 23 if (self != nil) { |
| 24 [self setImage:[NSImage imageNamed:@"nav"]]; |
| 25 } |
| 26 return self; |
| 27 } |
| 28 |
| 29 // Called when the tab's nib is done loading and all outlets are hooked up. |
| 30 - (void)awakeFromNib { |
| 31 [[self view] addSubview:backgroundButton_ |
| 32 positioned:NSWindowBelow |
| 33 relativeTo:nil]; |
| 34 // TODO(alcor): figure out what to do with the close button v. cell. Note |
| 35 // there is no close button in the nib at the moment. |
| 36 [closeButton_ setWantsLayer:YES]; |
| 37 [closeButton_ setAlphaValue:0.2]; |
| 38 [self setSelected:NO]; |
| 39 } |
| 40 |
| 41 - (void)setSelected:(BOOL)selected { |
| 42 selected_ = selected; |
| 43 [backgroundButton_ setState:selected]; |
| 44 [[self view] setNeedsDisplay:YES]; |
| 45 } |
| 46 |
| 47 - (BOOL)selected { |
| 48 return selected_; |
| 49 } |
| 50 |
| 51 @end |
| OLD | NEW |