OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/cocoa/infobars/infobar_container_controller.h" | 5 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // This code can be executed while InfoBarController is still on the stack, so | 148 // This code can be executed while InfoBarController is still on the stack, so |
149 // we retain and autorelease the controller to prevent it from being | 149 // we retain and autorelease the controller to prevent it from being |
150 // dealloc'ed too early. | 150 // dealloc'ed too early. |
151 [[controller retain] autorelease]; | 151 [[controller retain] autorelease]; |
152 [[controller view] removeFromSuperview]; | 152 [[controller view] removeFromSuperview]; |
153 [infobarControllers_ removeObject:controller]; | 153 [infobarControllers_ removeObject:controller]; |
154 } | 154 } |
155 | 155 |
156 - (void)setMaxTopArrowHeight:(NSInteger)height { | 156 - (void)setMaxTopArrowHeight:(NSInteger)height { |
157 containerCocoa_->SetMaxTopArrowHeight(height); | 157 containerCocoa_->SetMaxTopArrowHeight(height, containerCocoa_.get()); |
158 } | 158 } |
159 | 159 |
160 - (CGFloat)heightOfInfoBars { | 160 - (CGFloat)heightOfInfoBars { |
161 CGFloat totalHeight = 0; | 161 CGFloat totalHeight = 0; |
162 for (InfoBarController* controller in infobarControllers_.get()) { | 162 for (InfoBarController* controller in infobarControllers_.get()) { |
163 totalHeight += [controller infobar]->total_height() - | 163 totalHeight += [controller infobar]->total_height() - |
164 [controller infobar]->arrow_height(); | 164 [controller infobar]->arrow_height(); |
165 } | 165 } |
166 return totalHeight; | 166 return totalHeight; |
167 } | 167 } |
168 | 168 |
169 @end | 169 @end |
OLD | NEW |