OLD | NEW |
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 if (hide == [homeButton_ isHidden]) | 531 if (hide == [homeButton_ isHidden]) |
532 return; // Nothing to do, view state matches pref state. | 532 return; // Nothing to do, view state matches pref state. |
533 | 533 |
534 // Always shift the text field by the width of the home button minus one pixel | 534 // Always shift the text field by the width of the home button minus one pixel |
535 // since the frame edges of each button are right on top of each other. When | 535 // since the frame edges of each button are right on top of each other. When |
536 // hiding the button, reverse the direction of the movement (to the left). | 536 // hiding the button, reverse the direction of the movement (to the left). |
537 CGFloat moveX = [homeButton_ frame].size.width - 1.0; | 537 CGFloat moveX = [homeButton_ frame].size.width - 1.0; |
538 if (hide) | 538 if (hide) |
539 moveX *= -1; // Reverse the direction of the move. | 539 moveX *= -1; // Reverse the direction of the move. |
540 | 540 |
541 [reloadButton_ setFrame:NSOffsetRect([reloadButton_ frame], moveX, 0)]; | |
542 [locationBar_ setFrame:[self adjustRect:[locationBar_ frame] | 541 [locationBar_ setFrame:[self adjustRect:[locationBar_ frame] |
543 byAmount:moveX]]; | 542 byAmount:moveX]]; |
544 [homeButton_ setHidden:hide]; | 543 [homeButton_ setHidden:hide]; |
545 } | 544 } |
546 | 545 |
547 // Install the menu wrench buttons. Calling this repeatedly is inexpensive so it | 546 // Install the menu wrench buttons. Calling this repeatedly is inexpensive so it |
548 // can be done every time the buttons are shown. | 547 // can be done every time the buttons are shown. |
549 - (void)installWrenchMenu { | 548 - (void)installWrenchMenu { |
550 if (wrenchMenuModel_.get()) | 549 if (wrenchMenuModel_.get()) |
551 return; | 550 return; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { | 792 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { |
794 // Do nothing. | 793 // Do nothing. |
795 } | 794 } |
796 | 795 |
797 // (URLDropTargetController protocol) | 796 // (URLDropTargetController protocol) |
798 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 797 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
799 // Do nothing. | 798 // Do nothing. |
800 } | 799 } |
801 | 800 |
802 @end | 801 @end |
OLD | NEW |