summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 01:17:20 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 01:17:20 +0000
commit61dd7efa16c8f62d07588aaca7163ad3052bb99e (patch)
treeb98e3aa5d1177249dca0730d30936edfdc3d5e20 /chrome/browser/cocoa
parent1d27bbe75c720677abab13569a62263204819a90 (diff)
downloadchromium_src-61dd7efa16c8f62d07588aaca7163ad3052bb99e.zip
chromium_src-61dd7efa16c8f62d07588aaca7163ad3052bb99e.tar.gz
chromium_src-61dd7efa16c8f62d07588aaca7163ad3052bb99e.tar.bz2
Mac: Try to make sure that the first run bubble always disappears.
BUG=52726 TEST=The first run bubble should work as before for normal people. For deepakg, it should no longer stick around forever. Review URL: http://codereview.chromium.org/3312018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/first_run_bubble_controller.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/first_run_bubble_controller.mm b/chrome/browser/cocoa/first_run_bubble_controller.mm
index 6c4ea32..0469eee 100644
--- a/chrome/browser/cocoa/first_run_bubble_controller.mm
+++ b/chrome/browser/cocoa/first_run_bubble_controller.mm
@@ -16,6 +16,7 @@
- (id)initRelativeToView:(NSView*)view
offset:(NSPoint)offset
profile:(Profile*)profile;
+- (void)closeIfNotKey;
@end
@implementation FirstRunBubbleController
@@ -37,6 +38,13 @@
offset:offset])) {
profile_ = profile;
[self showWindow:nil];
+
+ // On 10.5, the first run bubble sometimes does not disappear when clicking
+ // the omnibox. This happens if the bubble never became key, due to it
+ // showing up so early in the startup sequence. As a workaround, close it
+ // automatically after a few seconds if it doesn't become key.
+ // http://crbug.com/52726
+ [self performSelector:@selector(closeIfNotKey) withObject:nil afterDelay:3];
}
return self;
}
@@ -59,4 +67,18 @@
[[self window] setFrame:frame display:YES];
}
+- (void)close {
+ // If the window is closed before the timer is fired, cancel the timer, since
+ // it retains the controller.
+ [NSObject cancelPreviousPerformRequestsWithTarget:self
+ selector:@selector(closeIfNotKey)
+ object:nil];
+ [super close];
+}
+
+- (void)closeIfNotKey {
+ if (![[self window] isKeyWindow])
+ [self close];
+}
+
@end // FirstRunBubbleController