summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/info_bubble_window.mm
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-21 20:34:26 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-21 20:34:26 +0000
commit718eb087d45506befae5ecdc3fae1296c988d194 (patch)
tree58309acc9353e89cef148574820e6ff0a47ddaa6 /chrome/browser/cocoa/info_bubble_window.mm
parent1f14a913d60da63f3e4eb73cf4dea134e1ec75d0 (diff)
downloadchromium_src-718eb087d45506befae5ecdc3fae1296c988d194.zip
chromium_src-718eb087d45506befae5ecdc3fae1296c988d194.tar.gz
chromium_src-718eb087d45506befae5ecdc3fae1296c988d194.tar.bz2
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
Diffstat (limited to 'chrome/browser/cocoa/info_bubble_window.mm')
-rw-r--r--chrome/browser/cocoa/info_bubble_window.mm19
1 files changed, 14 insertions, 5 deletions
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