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

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

Issue 2716283003: [Mac] Shrink width of browser action container when location bar is min size (Closed)
Patch Set: Created 3 years, 9 months 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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 [browserActionsContainerView_ setGrippyPinned:YES]; 872 [browserActionsContainerView_ setGrippyPinned:YES];
873 NSRect containerFrame = [browserActionsContainerView_ frame]; 873 NSRect containerFrame = [browserActionsContainerView_ frame];
874 // Determine how much the container needs to move in case it's overlapping 874 // Determine how much the container needs to move in case it's overlapping
875 // with the location bar. 875 // with the location bar.
876 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { 876 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
877 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]); 877 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]);
878 containerFrame.size.width -= dX; 878 containerFrame.size.width -= dX;
879 } else { 879 } else {
880 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x; 880 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x;
881 containerFrame = NSOffsetRect(containerFrame, dX, 0); 881 containerFrame = NSOffsetRect(containerFrame, dX, 0);
882 containerFrame.size.width -= dX;
882 } 883 }
883 [browserActionsContainerView_ setFrame:containerFrame]; 884 [browserActionsContainerView_ setFrame:containerFrame];
884 } else if (!locationBarAtMinSize_ && 885 } else if (!locationBarAtMinSize_ &&
885 [browserActionsContainerView_ grippyPinned]) { 886 [browserActionsContainerView_ grippyPinned]) {
886 // Expand out the container until it hits the saved size, then unpin the 887 // Expand out the container until it hits the saved size, then unpin the
887 // grippy. 888 // grippy.
888 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above. 889 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above.
889 CGFloat dX = NSWidth([locationBar_ frame]) - 890 CGFloat dX = NSWidth([locationBar_ frame]) -
890 (kMinimumLocationBarWidth + 0.1); 891 (kMinimumLocationBarWidth + 0.1);
891 NSRect containerFrame = [browserActionsContainerView_ frame]; 892 NSRect containerFrame = [browserActionsContainerView_ frame];
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 - (void)hideDropURLsIndicatorInView:(NSView*)view { 1091 - (void)hideDropURLsIndicatorInView:(NSView*)view {
1091 // Do nothing. 1092 // Do nothing.
1092 } 1093 }
1093 1094
1094 // (URLDropTargetController protocol) 1095 // (URLDropTargetController protocol)
1095 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 1096 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
1096 return drag_util::IsUnsupportedDropData(profile_, info); 1097 return drag_util::IsUnsupportedDropData(profile_, info);
1097 } 1098 }
1098 1099
1099 @end 1100 @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