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

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

Issue 3007025: Merge 54188 - [Mac] First pass at final sizing of toolbar items.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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
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 "app/menus/accelerator_cocoa.h" 10 #include "app/menus/accelerator_cocoa.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 if (hide == [homeButton_ isHidden]) 514 if (hide == [homeButton_ isHidden])
515 return; // Nothing to do, view state matches pref state. 515 return; // Nothing to do, view state matches pref state.
516 516
517 // Always shift the text field by the width of the home button minus one pixel 517 // Always shift the text field by the width of the home button minus one pixel
518 // since the frame edges of each button are right on top of each other. When 518 // since the frame edges of each button are right on top of each other. When
519 // hiding the button, reverse the direction of the movement (to the left). 519 // hiding the button, reverse the direction of the movement (to the left).
520 CGFloat moveX = [homeButton_ frame].size.width - 1.0; 520 CGFloat moveX = [homeButton_ frame].size.width - 1.0;
521 if (hide) 521 if (hide)
522 moveX *= -1; // Reverse the direction of the move. 522 moveX *= -1; // Reverse the direction of the move.
523 523
524 [reloadButton_ setFrame:NSOffsetRect([reloadButton_ frame], moveX, 0)];
525 [locationBar_ setFrame:[self adjustRect:[locationBar_ frame] 524 [locationBar_ setFrame:[self adjustRect:[locationBar_ frame]
526 byAmount:moveX]]; 525 byAmount:moveX]];
527 [homeButton_ setHidden:hide]; 526 [homeButton_ setHidden:hide];
528 } 527 }
529 528
530 // Install the menu wrench buttons. Calling this repeatedly is inexpensive so it 529 // Install the menu wrench buttons. Calling this repeatedly is inexpensive so it
531 // can be done every time the buttons are shown. 530 // can be done every time the buttons are shown.
532 - (void)installWrenchMenu { 531 - (void)installWrenchMenu {
533 if (wrenchMenuModel_.get()) 532 if (wrenchMenuModel_.get())
534 return; 533 return;
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { 782 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point {
784 // Do nothing. 783 // Do nothing.
785 } 784 }
786 785
787 // (URLDropTargetController protocol) 786 // (URLDropTargetController protocol)
788 - (void)hideDropURLsIndicatorInView:(NSView*)view { 787 - (void)hideDropURLsIndicatorInView:(NSView*)view {
789 // Do nothing. 788 // Do nothing.
790 } 789 }
791 790
792 @end 791 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/location_bar/location_bar_view_mac.mm ('k') | chrome/browser/cocoa/toolbar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698