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

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

Issue 2709083005: [Mac] Shrink width of browser action container when location bar is min size (Closed)
Patch Set: Created 3 years, 10 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 <sys/stat.h> 7 #include <sys/stat.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/debug/crash_logging.h" 10 #include "base/debug/crash_logging.h"
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 [browserActionsContainerView_ setGrippyPinned:YES]; 889 [browserActionsContainerView_ setGrippyPinned:YES];
890 NSRect containerFrame = [browserActionsContainerView_ frame]; 890 NSRect containerFrame = [browserActionsContainerView_ frame];
891 // Determine how much the container needs to move in case it's overlapping 891 // Determine how much the container needs to move in case it's overlapping
892 // with the location bar. 892 // with the location bar.
893 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { 893 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
894 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]); 894 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]);
895 containerFrame.size.width -= dX; 895 containerFrame.size.width -= dX;
896 } else { 896 } else {
897 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x; 897 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x;
898 containerFrame = NSOffsetRect(containerFrame, dX, 0); 898 containerFrame = NSOffsetRect(containerFrame, dX, 0);
899 containerFrame.size.width -= dX;
899 } 900 }
900 [browserActionsContainerView_ setFrame:containerFrame]; 901 [browserActionsContainerView_ setFrame:containerFrame];
901 } else if (!locationBarAtMinSize_ && 902 } else if (!locationBarAtMinSize_ &&
902 [browserActionsContainerView_ grippyPinned]) { 903 [browserActionsContainerView_ grippyPinned]) {
903 // Expand out the container until it hits the saved size, then unpin the 904 // Expand out the container until it hits the saved size, then unpin the
904 // grippy. 905 // grippy.
905 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above. 906 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above.
906 CGFloat dX = NSWidth([locationBar_ frame]) - 907 CGFloat dX = NSWidth([locationBar_ frame]) -
907 (kMinimumLocationBarWidth + 0.1); 908 (kMinimumLocationBarWidth + 0.1);
908 NSRect containerFrame = [browserActionsContainerView_ frame]; 909 NSRect containerFrame = [browserActionsContainerView_ frame];
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 - (void)hideDropURLsIndicatorInView:(NSView*)view { 1108 - (void)hideDropURLsIndicatorInView:(NSView*)view {
1108 // Do nothing. 1109 // Do nothing.
1109 } 1110 }
1110 1111
1111 // (URLDropTargetController protocol) 1112 // (URLDropTargetController protocol)
1112 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 1113 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
1113 return drag_util::IsUnsupportedDropData(profile_, info); 1114 return drag_util::IsUnsupportedDropData(profile_, info);
1114 } 1115 }
1115 1116
1116 @end 1117 @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