| 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 "base/mac_util.h" | 7 #include "base/mac_util.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
| 10 #import "chrome/browser/cocoa/autocomplete_text_field.h" | 10 #import "chrome/browser/cocoa/autocomplete_text_field.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 parentView:[self view] | 112 parentView:[self view] |
| 113 webContentView:webContentView_ | 113 webContentView:webContentView_ |
| 114 infoBarsView:infoBarsView_ | 114 infoBarsView:infoBarsView_ |
| 115 delegate:bookmarkBarDelegate_]); | 115 delegate:bookmarkBarDelegate_]); |
| 116 | 116 |
| 117 // Add bookmark bar to the view hierarchy. This also triggers the | 117 // Add bookmark bar to the view hierarchy. This also triggers the |
| 118 // nib load. The bookmark bar is defined (in the nib) to be | 118 // nib load. The bookmark bar is defined (in the nib) to be |
| 119 // bottom-aligned to it's parent view (among other things), so | 119 // bottom-aligned to it's parent view (among other things), so |
| 120 // position and resize properties don't need to be set. | 120 // position and resize properties don't need to be set. |
| 121 [[self view] addSubview:[bookmarkBarController_ view]]; | 121 [[self view] addSubview:[bookmarkBarController_ view]]; |
| 122 |
| 123 // For a popup window, the toolbar is really just a location bar |
| 124 // (see override for [ToolbarController view], below). When going |
| 125 // fullscreen, we remove the toolbar controller's view from the view |
| 126 // hierarchy. Calling [locationBar_ removeFromSuperview] when going |
| 127 // fullscreen causes it to get released, making us unhappy |
| 128 // (http://crbug.com/18551). We avoid the problem by incrementing |
| 129 // the retain count of the location bar; use of the scoped object |
| 130 // helps us remember to release it. |
| 131 locationBarRetainer_.reset([locationBar_ retain]); |
| 122 } | 132 } |
| 123 | 133 |
| 124 - (LocationBar*)locationBar { | 134 - (LocationBar*)locationBar { |
| 125 return locationBarView_.get(); | 135 return locationBarView_.get(); |
| 126 } | 136 } |
| 127 | 137 |
| 128 - (void)focusLocationBar { | 138 - (void)focusLocationBar { |
| 129 if (locationBarView_.get()) { | 139 if (locationBarView_.get()) { |
| 130 locationBarView_->FocusLocation(); | 140 locationBarView_->FocusLocation(); |
| 131 } | 141 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 forView:pageButton_]; | 330 forView:pageButton_]; |
| 321 } | 331 } |
| 322 | 332 |
| 323 - (IBAction)showWrenchMenu:(id)sender { | 333 - (IBAction)showWrenchMenu:(id)sender { |
| 324 [NSMenu popUpContextMenu:wrenchMenu_ | 334 [NSMenu popUpContextMenu:wrenchMenu_ |
| 325 withEvent:[NSApp currentEvent] | 335 withEvent:[NSApp currentEvent] |
| 326 forView:wrenchButton_]; | 336 forView:wrenchButton_]; |
| 327 } | 337 } |
| 328 | 338 |
| 329 @end | 339 @end |
| OLD | NEW |