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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/tab_controller.mm
===================================================================
--- chrome/browser/cocoa/tab_controller.mm (revision 0)
+++ chrome/browser/cocoa/tab_controller.mm (revision 0)
@@ -0,0 +1,51 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/tab_controller.h"
+
+@implementation TabController
+
+@synthesize image = image_;
+@synthesize loading = loading_;
+@synthesize target = target_;
+@synthesize action = action_;
+
++ (float)minTabWidth { return 64.0; }
++ (float)maxTabWidth { return 160.0; }
+
+- (TabView*)tabView {
+ return static_cast<TabView*>([self view]);
+}
+
+- (id)init {
+ self = [super initWithNibName:@"TabView" bundle:nil];
+ if (self != nil) {
+ [self setImage:[NSImage imageNamed:@"nav"]];
+ }
+ return self;
+}
+
+// Called when the tab's nib is done loading and all outlets are hooked up.
+- (void)awakeFromNib {
+ [[self view] addSubview:backgroundButton_
+ positioned:NSWindowBelow
+ relativeTo:nil];
+ // TODO(alcor): figure out what to do with the close button v. cell. Note
+ // there is no close button in the nib at the moment.
+ [closeButton_ setWantsLayer:YES];
+ [closeButton_ setAlphaValue:0.2];
+ [self setSelected:NO];
+}
+
+- (void)setSelected:(BOOL)selected {
+ 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.
+ [backgroundButton_ setState:selected];
+ [[self view] setNeedsDisplay:YES];
+}
+
+- (BOOL)selected {
+ return selected_;
+}
+
+@end
Property changes on: chrome/browser/cocoa/tab_controller.mm
___________________________________________________________________
Name: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698