From 718eb087d45506befae5ecdc3fae1296c988d194 Mon Sep 17 00:00:00 2001 From: "jrg@chromium.org" Date: Mon, 21 Dec 2009 20:34:26 +0000 Subject: Fix some valgrind failures. BUG=http://crbug.com/18158, http://crbug.com/30381, http://crbug.com/30371, http://crbug.com/30373 TEST=valgrind bots green. Bookmark bubble still works. Review URL: http://codereview.chromium.org/503064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35100 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/info_bubble_window.mm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'chrome/browser/cocoa/info_bubble_window.mm') diff --git a/chrome/browser/cocoa/info_bubble_window.mm b/chrome/browser/cocoa/info_bubble_window.mm index b415eb2..47fe38d 100644 --- a/chrome/browser/cocoa/info_bubble_window.mm +++ b/chrome/browser/cocoa/info_bubble_window.mm @@ -51,6 +51,8 @@ const NSTimeInterval kOrderOutAnimationDuration = 0.15; @implementation InfoBubbleWindow +@synthesize delayOnClose = delayOnClose_; + - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType @@ -63,6 +65,7 @@ const NSTimeInterval kOrderOutAnimationDuration = 0.15; [self setExcludedFromWindowsMenu:YES]; [self setOpaque:NO]; [self setHasShadow:YES]; + delayOnClose_ = YES; // Start invisible. Will be made visible when ordered front. [self setAlphaValue:0.0]; @@ -96,12 +99,17 @@ const NSTimeInterval kOrderOutAnimationDuration = 0.15; - (void)close { // Block the window from receiving events while it fades out. closing_ = YES; - // Apply animations to hide self. - [NSAnimationContext beginGrouping]; - [[NSAnimationContext currentContext] + + if (!delayOnClose_) { + [self finishCloseAfterAnimation]; + } else { + // Apply animations to hide self. + [NSAnimationContext beginGrouping]; + [[NSAnimationContext currentContext] gtm_setDuration:kOrderOutAnimationDuration]; - [[self animator] setAlphaValue:0.0]; - [NSAnimationContext endGrouping]; + [[self animator] setAlphaValue:0.0]; + [NSAnimationContext endGrouping]; + } } // Called by InfoBubbleWindowCloser when the window is to be really closed @@ -151,4 +159,5 @@ const NSTimeInterval kOrderOutAnimationDuration = 0.15; - (BOOL)isClosing { return closing_; } + @end -- cgit v1.1