OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/nsimage_cache_mac.h" | 9 #include "base/nsimage_cache_mac.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // the xib, we must set them in code. | 141 // the xib, we must set them in code. |
142 [backButton_ setImage:nsimage_cache::ImageNamed(kBackButtonImageName)]; | 142 [backButton_ setImage:nsimage_cache::ImageNamed(kBackButtonImageName)]; |
143 [forwardButton_ setImage:nsimage_cache::ImageNamed(kForwardButtonImageName)]; | 143 [forwardButton_ setImage:nsimage_cache::ImageNamed(kForwardButtonImageName)]; |
144 [reloadButton_ setImage:nsimage_cache::ImageNamed(kReloadButtonImageName)]; | 144 [reloadButton_ setImage:nsimage_cache::ImageNamed(kReloadButtonImageName)]; |
145 [homeButton_ setImage:nsimage_cache::ImageNamed(kHomeButtonImageName)]; | 145 [homeButton_ setImage:nsimage_cache::ImageNamed(kHomeButtonImageName)]; |
146 [starButton_ setImage:nsimage_cache::ImageNamed(kStarButtonImageName)]; | 146 [starButton_ setImage:nsimage_cache::ImageNamed(kStarButtonImageName)]; |
147 [goButton_ setImage:nsimage_cache::ImageNamed(kGoButtonGoImageName)]; | 147 [goButton_ setImage:nsimage_cache::ImageNamed(kGoButtonGoImageName)]; |
148 [pageButton_ setImage:nsimage_cache::ImageNamed(kPageButtonImageName)]; | 148 [pageButton_ setImage:nsimage_cache::ImageNamed(kPageButtonImageName)]; |
149 [wrenchButton_ setImage:nsimage_cache::ImageNamed(kWrenchButtonImageName)]; | 149 [wrenchButton_ setImage:nsimage_cache::ImageNamed(kWrenchButtonImageName)]; |
150 | 150 |
| 151 [pageButton_ setShowsBorderOnlyWhileMouseInside:YES]; |
| 152 [wrenchButton_ setShowsBorderOnlyWhileMouseInside:YES]; |
| 153 |
151 [self initCommandStatus:commands_]; | 154 [self initCommandStatus:commands_]; |
152 bubblePositioner_.reset(new BubblePositionerMac(self)); | 155 bubblePositioner_.reset(new BubblePositionerMac(self)); |
153 locationBarView_.reset(new LocationBarViewMac(locationBar_, | 156 locationBarView_.reset(new LocationBarViewMac(locationBar_, |
154 bubblePositioner_.get(), | 157 bubblePositioner_.get(), |
155 commands_, toolbarModel_, | 158 commands_, toolbarModel_, |
156 profile_)); | 159 profile_)); |
157 [locationBar_ setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]]; | 160 [locationBar_ setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]]; |
158 | 161 |
159 // Register pref observers for the optional home and page/options buttons | 162 // Register pref observers for the optional home and page/options buttons |
160 // and then add them to the toolbar them based on those prefs. | 163 // and then add them to the toolbar them based on those prefs. |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 524 |
522 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, | 525 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, |
523 NSHeight(locationFrame)); | 526 NSHeight(locationFrame)); |
524 gfx::Rect stack_bounds( | 527 gfx::Rect stack_bounds( |
525 NSRectToCGRect([[self view] convertRect:r toView:nil])); | 528 NSRectToCGRect([[self view] convertRect:r toView:nil])); |
526 // Inset the bounds to just inside the visible edges (see comment above). | 529 // Inset the bounds to just inside the visible edges (see comment above). |
527 stack_bounds.Inset(kLocationStackEdgeWidth, 0); | 530 stack_bounds.Inset(kLocationStackEdgeWidth, 0); |
528 return stack_bounds; | 531 return stack_bounds; |
529 } | 532 } |
530 @end | 533 @end |
OLD | NEW |