summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/toolbar_controller.mm
diff options
context:
space:
mode:
authorandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 20:07:31 +0000
committerandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 20:07:31 +0000
commit9b5fe303ff7f97595594e1dec04ce5b96610c748 (patch)
treed96383706e3318e7255155cd8db3a1f657f5b819 /chrome/browser/cocoa/toolbar_controller.mm
parentaf19338e9e281cb36b94c198a95d1e9a760e767b (diff)
downloadchromium_src-9b5fe303ff7f97595594e1dec04ce5b96610c748.zip
chromium_src-9b5fe303ff7f97595594e1dec04ce5b96610c748.tar.gz
chromium_src-9b5fe303ff7f97595594e1dec04ce5b96610c748.tar.bz2
[Mac] UI changes for the Browser Actions toolbar container.
o Grippy is hidden for now pending new UI. You can still resize just fine. o The right divider is removed since the wrench menu is now always being shown. TEST=none BUG=45764 Review URL: http://codereview.chromium.org/2863013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50375 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/toolbar_controller.mm')
-rw-r--r--chrome/browser/cocoa/toolbar_controller.mm22
1 files changed, 6 insertions, 16 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm
index 5c28d66..a17948d 100644
--- a/chrome/browser/cocoa/toolbar_controller.mm
+++ b/chrome/browser/cocoa/toolbar_controller.mm
@@ -55,10 +55,6 @@ NSString* const kWrenchButtonImageName = @"menu_chrome_Template.pdf";
// Height of the toolbar in pixels when the bookmark bar is closed.
const CGFloat kBaseToolbarHeight = 36.0;
-// The distance from the location bar to the Browser Actions container
-// in pixels.
-const CGFloat kBrowserActionsContainerLeftPadding = 5.0;
-
// The minimum width of the location bar in pixels.
const CGFloat kMinimumLocationBarWidth = 100.0;
@@ -558,9 +554,6 @@ class PrefObserverBridge : public NotificationObserver {
NSWidth([browserActionsContainerView_ frame]);
if (containerWidth > 0.0)
[self adjustLocationSizeBy:(containerWidth * -1) animate:NO];
- // Right border should always be visible because wrench menu can no longer
- // hide.
- [browserActionsContainerView_ setRightBorderShown:YES];
}
- (void)adjustBrowserActionsContainerForNewWindow:
@@ -592,22 +585,20 @@ class PrefObserverBridge : public NotificationObserver {
- (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate {
CGFloat locationBarXPos = NSMaxX([locationBar_ frame]);
- CGFloat leftPadding;
+ CGFloat leftDistance;
if ([browserActionsContainerView_ isHidden]) {
CGFloat edgeXPos = [wrenchButton_ frame].origin.x;
- leftPadding = edgeXPos - locationBarXPos;
+ leftDistance = edgeXPos - locationBarXPos;
} else {
NSRect containerFrame = animate ?
[browserActionsContainerView_ animationEndFrame] :
[browserActionsContainerView_ frame];
- leftPadding = containerFrame.origin.x - locationBarXPos;
- }
- if (leftPadding != kBrowserActionsContainerLeftPadding) {
- CGFloat dX = leftPadding - kBrowserActionsContainerLeftPadding;
- [self adjustLocationSizeBy:dX animate:animate];
+ leftDistance = containerFrame.origin.x - locationBarXPos;
}
+ if (leftDistance != 0.0)
+ [self adjustLocationSizeBy:leftDistance animate:animate];
}
- (void)maintainMinimumLocationBarWidth {
@@ -633,8 +624,7 @@ class PrefObserverBridge : public NotificationObserver {
NSRect containerFrame = [browserActionsContainerView_ frame];
// Determine how much the container needs to move in case it's overlapping
// with the location bar.
- CGFloat dX = NSMaxX([locationBar_ frame]) -
- containerFrame.origin.x + kBrowserActionsContainerLeftPadding;
+ CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x;
containerFrame = NSOffsetRect(containerFrame, dX, 0);
containerFrame.size.width -= dX;
[browserActionsContainerView_ setFrame:containerFrame];