Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm

Issue 1105713002: [Extension Toolbar] Slide out overflowed actions for popups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698