summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_window_controller.mm
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 19:24:21 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 19:24:21 +0000
commitf745489d0208c9e4e061d0e7361f951fb5eb825c (patch)
treec85f3ed2ddd6d9ba3a1374c1ccc177ad802ea4cc /chrome/browser/browser_window_controller.mm
parent19b8d82f61d84ec8423e3f1c0223410501d35a93 (diff)
downloadchromium_src-f745489d0208c9e4e061d0e7361f951fb5eb825c.zip
chromium_src-f745489d0208c9e4e061d0e7361f951fb5eb825c.tar.gz
chromium_src-f745489d0208c9e4e061d0e7361f951fb5eb825c.tar.bz2
hookup tabs to the model and handle new tab creation
Review URL: http://codereview.chromium.org/19669 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_window_controller.mm')
-rw-r--r--chrome/browser/browser_window_controller.mm23
1 files changed, 11 insertions, 12 deletions
diff --git a/chrome/browser/browser_window_controller.mm b/chrome/browser/browser_window_controller.mm
index 8838a02..33892a3 100644
--- a/chrome/browser/browser_window_controller.mm
+++ b/chrome/browser/browser_window_controller.mm
@@ -6,7 +6,7 @@
#import "chrome/browser/browser_window_cocoa.h"
#import "chrome/browser/browser_window_controller.h"
#import "chrome/browser/cocoa/tab_bar_view.h"
-#import "chrome/browser/cocoa/tab_contents_controller.h"
+#import "chrome/browser/cocoa/tab_strip_controller.h"
@implementation BrowserWindowController
@@ -16,6 +16,7 @@
- (id)initWithBrowser:(Browser*)browser {
if ((self = [super initWithWindowNibName:@"BrowserWindow"])) {
browser_ = browser;
+ DCHECK(browser_);
windowShim_ = new BrowserWindowCocoa(self, [self window]);
}
return self;
@@ -25,6 +26,7 @@
browser_->CloseAllTabs();
delete browser_;
delete windowShim_;
+ [tabStripController_ release];
[contentsController_ release];
[super dealloc];
}
@@ -35,6 +37,14 @@
}
- (void)windowDidLoad {
+ // Create a controller for the tab strip, giving it the model object for
+ // this window's Browser and the tab strip view. The controller will handle
+ // registering for the appropriate tab notifications from the back-end and
+ // managing the creation of new tabs.
+ tabStripController_ =
+ [[TabStripController alloc]
+ initWithView:tabBarView_ model:browser_->tabstrip_model()];
+
// Place the tab bar above the content box and add it to the view hierarchy
// as a sibling of the content view so it can overlap with the window frame.
NSRect tabFrame = [contentBox_ frame];
@@ -42,17 +52,6 @@
tabFrame.size.height = NSHeight([tabBarView_ frame]);
[tabBarView_ setFrame:tabFrame];
[[[[self window] contentView] superview] addSubview:tabBarView_];
-
- // bring in a single copy of the tab contents for now. We'll do this for
- // real when we hook up the "add tab to browser window" logic flow.
- // TODO(pinkerton): hook this up to the tab code
- contentsController_ =
- [[TabContentsController alloc] initWithNibName:@"TabContents" bundle:nil];
- NSView* view = [contentsController_ view];
- NSRect frame = [[[self window] contentView] bounds];
- frame.size.height -= 14.0;
- [view setFrame:frame];
- [[[self window] contentView] addSubview:view];
}
- (void)destroyBrowser {