Index: chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm |
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm |
index d718eec153dc75ff690b75632600604f5e46e7bf..20bda3815550ae6fe70045b7e8524ca3bba4bec2 100644 |
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm |
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm |
@@ -21,6 +21,8 @@ NSString* const kBrowserActionsContainerWillAnimate = |
@"BrowserActionsContainerWillAnimate"; |
NSString* const kBrowserActionsContainerMouseEntered = |
@"BrowserActionsContainerMouseEntered"; |
+NSString* const kBrowserActionsContainerAnimationEnded = |
+ @"BrowserActionsContainerAnimationEnded"; |
NSString* const kTranslationWithDelta = |
@"TranslationWithDelta"; |
@@ -61,6 +63,7 @@ const CGFloat kMinimumContainerWidth = 3.0; |
resizeAnimation_.reset([[NSViewAnimation alloc] init]); |
[resizeAnimation_ setDuration:kAnimationDuration]; |
[resizeAnimation_ setAnimationBlockingMode:NSAnimationNonblocking]; |
+ [resizeAnimation_ setDelegate:self]; |
[self setHidden:YES]; |
} |
@@ -199,6 +202,28 @@ const CGFloat kMinimumContainerWidth = 3.0; |
object:self]; |
} |
+- (void)animationDidEnd:(NSAnimation*)animation { |
+ // We notify asynchronously so that the animation fully finishes before any |
+ // listeners do work. |
+ [self performSelector:@selector(notifyAnimationEnded) |
+ withObject:self |
+ afterDelay:0]; |
+} |
+ |
+- (void)animationDidStop:(NSAnimation*)animation { |
+ // We notify asynchronously so that the animation fully finishes before any |
+ // listeners do work. |
+ [self performSelector:@selector(notifyAnimationEnded) |
+ withObject:self |
+ afterDelay:0]; |
+} |
+ |
+- (void)notifyAnimationEnded { |
+ [[NSNotificationCenter defaultCenter] |
+ postNotificationName:kBrowserActionsContainerAnimationEnded |
+ object:self]; |
+} |
+ |
- (ViewID)viewID { |
return VIEW_ID_BROWSER_ACTION_TOOLBAR; |
} |