| 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/logging.h" // for NOTREACHED() | 7 #include "base/logging.h" // for NOTREACHED() |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // so that inner event loops don't cause us to try and remove the infobar | 259 // so that inner event loops don't cause us to try and remove the infobar |
| 260 // twice? http://crbug.com/54253 | 260 // twice? http://crbug.com/54253 |
| 261 [containerController_ removeDelegate:delegate_]; | 261 [containerController_ removeDelegate:delegate_]; |
| 262 } | 262 } |
| 263 | 263 |
| 264 - (void)cleanUpAfterAnimation:(BOOL)finished { | 264 - (void)cleanUpAfterAnimation:(BOOL)finished { |
| 265 // Don't need to do any cleanup if the bar was animating open. | 265 // Don't need to do any cleanup if the bar was animating open. |
| 266 if (!infoBarClosing_) | 266 if (!infoBarClosing_) |
| 267 return; | 267 return; |
| 268 | 268 |
| 269 // Notify the delegate that the infobar was closed. The delegate may delete | 269 // Notify the delegate that the infobar was closed. The delegate will delete |
| 270 // itself as a result of InfoBarClosed(), so we null out its pointer. | 270 // itself as a result of InfoBarClosed(), so we null out its pointer. |
| 271 if (delegate_) { | 271 if (delegate_) { |
| 272 delegate_->InfoBarClosed(); | 272 delegate_->InfoBarClosed(); |
| 273 delegate_ = NULL; | 273 delegate_ = NULL; |
| 274 } | 274 } |
| 275 | 275 |
| 276 // If the animation ran to completion, then we need to remove ourselves from | 276 // If the animation ran to completion, then we need to remove ourselves from |
| 277 // the container. If the animation was interrupted, then the container will | 277 // the container. If the animation was interrupted, then the container will |
| 278 // take care of removing us. | 278 // take care of removing us. |
| 279 // TODO(rohitrao): UGH! This works for now, but should be cleaner. | 279 // TODO(rohitrao): UGH! This works for now, but should be cleaner. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 LinkInfoBarController* controller = | 510 LinkInfoBarController* controller = |
| 511 [[LinkInfoBarController alloc] initWithDelegate:this]; | 511 [[LinkInfoBarController alloc] initWithDelegate:this]; |
| 512 return new InfoBar(controller); | 512 return new InfoBar(controller); |
| 513 } | 513 } |
| 514 | 514 |
| 515 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 515 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { |
| 516 ConfirmInfoBarController* controller = | 516 ConfirmInfoBarController* controller = |
| 517 [[ConfirmInfoBarController alloc] initWithDelegate:this]; | 517 [[ConfirmInfoBarController alloc] initWithDelegate:this]; |
| 518 return new InfoBar(controller); | 518 return new InfoBar(controller); |
| 519 } | 519 } |
| OLD | NEW |