summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller_private.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 13:33:18 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 13:33:18 +0000
commit97769960411d54051293efe322b5718bc6fa43e5 (patch)
treeb4613660fbc4a22ce51d898effa3a311782036b5 /chrome/browser/cocoa/browser_window_controller_private.mm
parent2bd1e500e34f73d0c7017b62f91337d49039efe9 (diff)
downloadchromium_src-97769960411d54051293efe322b5718bc6fa43e5.zip
chromium_src-97769960411d54051293efe322b5718bc6fa43e5.tar.gz
chromium_src-97769960411d54051293efe322b5718bc6fa43e5.tar.bz2
Remove traces of a toolbar controller and xib specific to side-tabs, that mock died on the vine. Toolbar is now indented along with the rest of the window content.
BUG=44773 TEST=hidden behind flag, nothing to test. Review URL: http://codereview.chromium.org/2824021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller_private.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller_private.mm47
1 files changed, 9 insertions, 38 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller_private.mm b/chrome/browser/cocoa/browser_window_controller_private.mm
index 13cf6b8..2c707a1 100644
--- a/chrome/browser/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/cocoa/browser_window_controller_private.mm
@@ -15,7 +15,6 @@
#import "chrome/browser/cocoa/find_bar_cocoa_controller.h"
#import "chrome/browser/cocoa/floating_bar_backing_view.h"
#import "chrome/browser/cocoa/fullscreen_controller.h"
-#import "chrome/browser/cocoa/side_tabs_toolbar_controller.h"
#import "chrome/browser/cocoa/tab_strip_controller.h"
#import "chrome/browser/cocoa/tab_strip_view.h"
#import "chrome/browser/cocoa/toolbar_controller.h"
@@ -171,12 +170,7 @@ willPositionSheet:(NSWindow*)sheet
DCHECK_GE(maxY, minY);
DCHECK_LE(maxY, NSMaxY(contentBounds) + yOffset);
- // Place the toolbar at the top of the reserved area. Even with vertical
- // tabs enabled, the toolbar takes up the entire top width.
- maxY = [self layoutToolbarAtMaxY:maxY width:width];
-
- // Position the vertical tab strip on the left, taking up the entire remaining
- // height.
+ // Position the vertical tab strip on the left, taking up the entire height.
// TODO(pinkerton): Make width not fixed.
const CGFloat kSidebarWidth = 200.0;
if ([self useVerticalTabs]) {
@@ -188,7 +182,10 @@ willPositionSheet:(NSWindow*)sheet
width -= kSidebarWidth;
}
- // If we're not displaying the bookmark bar below the infobar, then it goes
+ // Place the toolbar at the top of the reserved area.
+ maxY = [self layoutToolbarAtMinX:minX maxY:maxY width:width];
+
+ // If we're not displaying the bookmark bar below the infobar, then it goes
// immediately below the toolbar.
BOOL placeBookmarkBarBelowInfoBar = [self placeBookmarkBarBelowInfoBar];
if (!placeBookmarkBarBelowInfoBar)
@@ -288,13 +285,15 @@ willPositionSheet:(NSWindow*)sheet
return maxY;
}
-- (CGFloat)layoutToolbarAtMaxY:(CGFloat)maxY width:(CGFloat)width {
+- (CGFloat)layoutToolbarAtMinX:(CGFloat)minX
+ maxY:(CGFloat)maxY
+ width:(CGFloat)width {
NSView* toolbarView = [toolbarController_ view];
NSRect toolbarFrame = [toolbarView frame];
if ([self hasToolbar]) {
// The toolbar is present in the window, so we make room for it.
DCHECK(![toolbarView isHidden]);
- toolbarFrame.origin.x = 0;
+ toolbarFrame.origin.x = minX;
toolbarFrame.origin.y = maxY - NSHeight(toolbarFrame);
toolbarFrame.size.width = width;
maxY -= NSHeight(toolbarFrame);
@@ -495,32 +494,4 @@ willPositionSheet:(NSWindow*)sheet
[fullscreenController_ cancelAnimationAndTimers];
}
-// Removes existing toolbar and re-creates the appropriate toolbar controller
-// based on if vertical tabs are enabled.
-- (void)initializeToolbarWithBrowser:(Browser*)browser {
- // Remove existing view.
- [[toolbarController_ view] removeFromSuperview];
- toolbarController_.reset(nil);
-
- // Create appropriate toolbar controller.
- if ([self useVerticalTabs]) {
- toolbarController_.reset([[SideTabsToolbarController alloc]
- initWithModel:browser->toolbar_model()
- commands:browser->command_updater()
- profile:browser->profile()
- browser:browser
- resizeDelegate:self]);
- } else {
- 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]];
-}
-
@end // @implementation BrowserWindowController(Private)