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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 2490833002: [Mac] Fix tools menu button spacing when no extensions installed. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 [self pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:YES]; 833 [self pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:YES];
834 } 834 }
835 835
836 - (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { 836 - (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate {
837 CGFloat locationBarXPos = NSMaxX([locationBar_ frame]); 837 CGFloat locationBarXPos = NSMaxX([locationBar_ frame]);
838 CGFloat leftDistance = 0.0; 838 CGFloat leftDistance = 0.0;
839 839
840 if ([browserActionsContainerView_ isHidden]) { 840 if ([browserActionsContainerView_ isHidden]) {
841 CGFloat edgeXPos = [appMenuButton_ frame].origin.x; 841 CGFloat edgeXPos = [appMenuButton_ frame].origin.x;
842 leftDistance = edgeXPos - locationBarXPos - 842 leftDistance = edgeXPos - locationBarXPos -
843 [ToolbarController appMenuLeftPadding]; 843 [ToolbarController appMenuLeftPadding] - kButtonInset;
844 } else { 844 } else {
845 leftDistance = NSMinX([browserActionsContainerView_ animationEndFrame]) - 845 leftDistance = NSMinX([browserActionsContainerView_ animationEndFrame]) -
846 locationBarXPos; 846 locationBarXPos;
847 // Equalize the distance between the location bar and the first extension 847 // Equalize the distance between the location bar and the first extension
848 // button, and the distance between the location bar and home/reload button. 848 // button, and the distance between the location bar and home/reload button.
849 leftDistance -= kButtonInset; 849 leftDistance -= kButtonInset;
850 } 850 }
851 if (leftDistance != 0.0) 851 if (leftDistance != 0.0)
852 [self adjustLocationSizeBy:leftDistance animate:animate]; 852 [self adjustLocationSizeBy:leftDistance animate:animate];
853 else 853 else
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 - (void)hideDropURLsIndicatorInView:(NSView*)view { 1079 - (void)hideDropURLsIndicatorInView:(NSView*)view {
1080 // Do nothing. 1080 // Do nothing.
1081 } 1081 }
1082 1082
1083 // (URLDropTargetController protocol) 1083 // (URLDropTargetController protocol)
1084 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 1084 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
1085 return drag_util::IsUnsupportedDropData(profile_, info); 1085 return drag_util::IsUnsupportedDropData(profile_, info);
1086 } 1086 }
1087 1087
1088 @end 1088 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698