| Index: chrome/browser/cocoa/infobar_controller.mm
|
| ===================================================================
|
| --- chrome/browser/cocoa/infobar_controller.mm (revision 65711)
|
| +++ chrome/browser/cocoa/infobar_controller.mm (working copy)
|
| @@ -176,6 +176,8 @@
|
| }
|
|
|
| - (void)close {
|
| + delegate_ = NULL;
|
| +
|
| // Stop any running animations.
|
| [[self animatableView] stopAnimation];
|
| infoBarClosing_ = YES;
|
| @@ -183,9 +185,10 @@
|
| }
|
|
|
| - (void)animateClosed {
|
| + delegate_ = NULL;
|
| +
|
| // Start animating closed. We will receive a notification when the animation
|
| - // is done, at which point we can remove our view from the hierarchy and
|
| - // notify the delegate that the infobar was closed.
|
| + // is done, at which point we can remove our view from the hierarchy.
|
| [[self animatableView] animateToNewHeight:0 duration:kAnimateCloseDuration];
|
|
|
| // The above call may trigger an animationDidStop: notification for any
|
| @@ -248,7 +251,8 @@
|
| // been removed and |delegate_| is NULL. Is there a way to rewrite the code
|
| // so that inner event loops don't cause us to try and remove the infobar
|
| // twice? http://crbug.com/54253
|
| - [containerController_ removeDelegate:delegate_];
|
| + if (delegate_ != NULL)
|
| + [containerController_ removeDelegate:delegate_];
|
| }
|
|
|
| - (void)cleanUpAfterAnimation:(BOOL)finished {
|
| @@ -256,13 +260,6 @@
|
| if (!infoBarClosing_)
|
| return;
|
|
|
| - // Notify the delegate that the infobar was closed. The delegate may delete
|
| - // itself as a result of InfoBarClosed(), so we null out its pointer.
|
| - if (delegate_) {
|
| - delegate_->InfoBarClosed();
|
| - delegate_ = NULL;
|
| - }
|
| -
|
| // If the animation ran to completion, then we need to remove ourselves from
|
| // the container. If the animation was interrupted, then the container will
|
| // take care of removing us.
|
|
|