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

Side by Side Diff: chrome/browser/cocoa/tab_controller.mm

Issue 43137: Add a TabController class to manage a TabView (with corresponding xib). Rewri... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(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;
TVL 2009/03/12 15:56:42 see if the state changed to avoid updates if it's
pink (ping after 24hrs) 2009/03/12 16:04:48 Done.
43 [backgroundButton_ setState:selected];
44 [[self view] setNeedsDisplay:YES];
45 }
46
47 - (BOOL)selected {
48 return selected_;
49 }
50
51 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698