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 #include "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/mac/mac_util.h" | 6 #include "base/mac/mac_util.h" |
7 #include "chrome/browser/tab_contents/infobar_delegate.h" | 7 #include "chrome/browser/tab_contents/infobar_delegate.h" |
8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
9 #import "chrome/browser/ui/cocoa/animatable_view.h" | 9 #import "chrome/browser/ui/cocoa/animatable_view.h" |
10 #include "chrome/browser/ui/cocoa/infobar.h" | 10 #include "chrome/browser/ui/cocoa/infobar.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 [controller animateOpen]; | 175 [controller animateOpen]; |
176 else | 176 else |
177 [controller open]; | 177 [controller open]; |
178 } | 178 } |
179 | 179 |
180 - (void)closeInfoBarsForDelegate:(InfoBarDelegate*)delegate | 180 - (void)closeInfoBarsForDelegate:(InfoBarDelegate*)delegate |
181 animate:(BOOL)animate { | 181 animate:(BOOL)animate { |
182 for (InfoBarController* controller in | 182 for (InfoBarController* controller in |
183 [NSArray arrayWithArray:infobarControllers_.get()]) { | 183 [NSArray arrayWithArray:infobarControllers_.get()]) { |
184 if ([controller delegate] == delegate) { | 184 if ([controller delegate] == delegate) { |
| 185 [controller infobarWillClose]; |
185 if (animate) | 186 if (animate) |
186 [controller animateClosed]; | 187 [controller animateClosed]; |
187 else | 188 else |
188 [controller close]; | 189 [controller close]; |
189 } | 190 } |
190 } | 191 } |
191 } | 192 } |
192 | 193 |
193 - (void)replaceInfoBarsForDelegate:(InfoBarDelegate*)old_delegate | 194 - (void)replaceInfoBarsForDelegate:(InfoBarDelegate*)old_delegate |
194 with:(InfoBarDelegate*)new_delegate { | 195 with:(InfoBarDelegate*)new_delegate { |
(...skipping 25 matching lines...) Expand all Loading... |
220 frame.size.width = NSWidth(containerBounds); | 221 frame.size.width = NSWidth(containerBounds); |
221 frame.origin.y = minY; | 222 frame.origin.y = minY; |
222 minY += frame.size.height; | 223 minY += frame.size.height; |
223 [view setFrame:frame]; | 224 [view setFrame:frame]; |
224 } | 225 } |
225 | 226 |
226 [resizeDelegate_ resizeView:[self view] newHeight:[self desiredHeight]]; | 227 [resizeDelegate_ resizeView:[self view] newHeight:[self desiredHeight]]; |
227 } | 228 } |
228 | 229 |
229 @end | 230 @end |
OLD | NEW |