| 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |