diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 21:27:50 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 21:27:50 +0000 |
commit | 79fed69d92dede3b92fd3a175b520ae6949f9233 (patch) | |
tree | 85eb64e16e6bd40f974eb89f8326ffbb142e8bee /chrome/browser/cocoa/browser_window_controller.mm | |
parent | c8af9bba42a3f9275220c65b4aef626d2387140c (diff) | |
download | chromium_src-79fed69d92dede3b92fd3a175b520ae6949f9233.zip chromium_src-79fed69d92dede3b92fd3a175b520ae6949f9233.tar.gz chromium_src-79fed69d92dede3b92fd3a175b520ae6949f9233.tar.bz2 |
Initial cut at scaffolding for mac sidetabs. No visible changes to browser without --enable-vertical-tabs, and even then, don't expect it to work.
BUG=44773
TEST=infobars, bookmark bar, tab strip, etc should all behave correctly when showing, hiding, and widnow resizing. This cl should have no visible impact without the above flag on the command line.
Review URL: http://codereview.chromium.org/2475002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index bd89e6a..345eb00 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -233,10 +233,16 @@ // 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_.reset([[TabStripController alloc] - initWithView:[self tabStripView] - switchView:[self tabContentArea] - browser:browser_.get()]); + if (![self useVerticalTabs]) { + tabStripController_.reset([[TabStripController alloc] + initWithView:[self tabStripView] + switchView:[self tabContentArea] + browser:browser_.get()]); + } else { + // TODO(pinkerton): Load SideTabController when written and add it to the + // contentView. This should be abstracted into a separate method like + // the toolbar controller initialization below. + } // Create the infobar container view, so we can pass it to the // ToolbarController. @@ -249,15 +255,8 @@ // Create a controller for the toolbar, giving it the toolbar model object // and the toolbar view from the nib. The controller will handle // registering for the appropriate command state changes from the back-end. - toolbarController_.reset([[ToolbarController alloc] - initWithModel:browser->toolbar_model() - commands:browser->command_updater() - profile:browser->profile() - browser:browser - resizeDelegate:self]); - [toolbarController_ setHasToolbar:[self hasToolbar] - hasLocationBar:[self hasLocationBar]]; - [[[self window] contentView] addSubview:[toolbarController_ view]]; + // Adds the toolbar to the content area. + [self initializeToolbarWithBrowser:browser]; // Create a sub-controller for the bookmark bar. bookmarkBarController_.reset( @@ -1289,6 +1288,8 @@ // (Override of |TabWindowController| method.) - (BOOL)hasTabStrip { + if ([self useVerticalTabs]) + return NO; return [self supportsWindowFeature:Browser::FEATURE_TABSTRIP]; } @@ -1625,6 +1626,16 @@ willAnimateFromState:(bookmarks::VisualState)oldState isShrinkingFromZoomed_ = NO; } +- (void)toggleTabStripDisplayMode { + // TODO(pinkerton) re-initialize tab strip. Finish writing this method. + // Right now, it only switches one direction, which clearly isn't cool. + // [self initTabStrip:browser_->tabstrip_model()]; + [[self tabStripView] removeFromSuperview]; + [self initializeToolbarWithBrowser:browser_.get()]; + + [self layoutSubviews]; +} + @end // @implementation BrowserWindowController |