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

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

Issue 1555004: [Mac] Fixes bug where disabling the last browser action would cause the locat... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 8 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 | Annotate | Revision Log
« 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/cocoa/toolbar_controller.h" 5 #import "chrome/browser/cocoa/toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "base/mac_util.h" 10 #include "base/mac_util.h"
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 672
673 - (void)browserActionsVisibilityChanged:(NSNotification*)notification { 673 - (void)browserActionsVisibilityChanged:(NSNotification*)notification {
674 [self pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:NO]; 674 [self pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:NO];
675 } 675 }
676 676
677 - (void)pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { 677 - (void)pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate {
678 CGFloat goXPos = [goButton_ frame].origin.x + NSWidth([goButton_ frame]); 678 CGFloat goXPos = [goButton_ frame].origin.x + NSWidth([goButton_ frame]);
679 CGFloat leftPadding; 679 CGFloat leftPadding;
680 680
681 if ([browserActionsContainerView_ isHidden]) { 681 if ([browserActionsContainerView_ isHidden]) {
682 leftPadding = NSWidth([[goButton_ window] frame]) - goXPos; 682 CGFloat edgeXPos = [pageButton_ isHidden] ?
683 NSWidth([[goButton_ window] frame]) : [pageButton_ frame].origin.x;
684 leftPadding = edgeXPos - goXPos;
683 } else { 685 } else {
684 NSRect containerFrame = animate ? 686 NSRect containerFrame = animate ?
685 [browserActionsContainerView_ animationEndFrame] : 687 [browserActionsContainerView_ animationEndFrame] :
686 [browserActionsContainerView_ frame]; 688 [browserActionsContainerView_ frame];
687 689
688 leftPadding = containerFrame.origin.x - goXPos; 690 leftPadding = containerFrame.origin.x - goXPos;
689 } 691 }
690 if (leftPadding != kBrowserActionsContainerLeftPadding) { 692 if (leftPadding != kBrowserActionsContainerLeftPadding) {
691 CGFloat dX = leftPadding - kBrowserActionsContainerLeftPadding; 693 CGFloat dX = leftPadding - kBrowserActionsContainerLeftPadding;
692 [self adjustLocationAndGoPositionsBy:dX animate:animate]; 694 [self adjustLocationAndGoPositionsBy:dX animate:animate];
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { 897 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point {
896 // Do nothing. 898 // Do nothing.
897 } 899 }
898 900
899 // (URLDropTargetController protocol) 901 // (URLDropTargetController protocol)
900 - (void)hideDropURLsIndicatorInView:(NSView*)view { 902 - (void)hideDropURLsIndicatorInView:(NSView*)view {
901 // Do nothing. 903 // Do nothing.
902 } 904 }
903 905
904 @end 906 @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